https://www.acmicpc.net/problem/2775
Idea
너무 쉬워서 아무생각 없이 품. ..
Code
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
void getResult();
int arr[16][16] = { 0, };
int main(void) {
int t;
int f, n; // floor , unit number
int length;
getResult();
scanf("%d", &t);
for (int i = 0; i < t; i++) {
scanf("%d %d", &f, &n);
printf("%d\n", arr[f][n]);
}
return 0;
}
void getResult() {
for (int i = 0; i < 15; i++) {
for (int j = 0; j < 15; j++) {
if (i == 0) {
arr[i][j] = j;
}
else {
arr[i][j] = arr[i - 1][j] + arr[i][j - 1];
}
}
}
}
ㅋ