티스토리 뷰
백준 2775번
문제 사이트 :
https://www.acmicpc.net/problem/2775
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
using namespace std;
#define Max 15
int Map[Max][Max];
int main(void) {
for (int x = 0; x < Max; x++) {
Map[0][x] = x+1;
}
for (int y = 1; y < Max; y++) {
Map[y][0] = 1;
}
for (int y = 1; y < Max; y++) {
for (int x = 1; x < Max; x++) {
Map[y][x] = Map[y][x-1] + Map[y-1][x];
}
}
int Testcase;
scanf("%d", &Testcase);
for (int T = 0; T < Testcase; T++) {
int k, n;
scanf("%d", &k);
scanf("%d", &n);
printf("%d\n", Map[k][n-1]);
}
return 0;
}
'PS > 백준' 카테고리의 다른 글
| 1475번 방 번호 (0) | 2019.06.24 |
|---|---|
| 10250번 ACM 호텔 (0) | 2019.06.24 |
| 1193번 분수찾기 (0) | 2019.06.24 |
| 2292번 벌집 (0) | 2019.06.24 |
| 11654번 아스키 코드 (0) | 2019.06.24 |
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- 디자인패턴
- 싱글톤
- ios
- Human Interface Guidelines
- MVC
- apple
- 부스트코스
- HIG
- UIView
- DP
- HumanInterfaceGuidelines
- 오토레이아웃
- Human Interface Guideline
- 알고리즘
- 분할정복
- 온라인저지
- Swift
- Firebase
- 백준
- storage
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | ||||||
| 2 | 3 | 4 | 5 | 6 | 7 | 8 |
| 9 | 10 | 11 | 12 | 13 | 14 | 15 |
| 16 | 17 | 18 | 19 | 20 | 21 | 22 |
| 23 | 24 | 25 | 26 | 27 | 28 | 29 |
| 30 |
글 보관함
