VioletaBabel

9507번: Generations of Tribbles 본문

백준/백준-C++
9507번: Generations of Tribbles
Beabletoet 2017. 6. 4. 14:57

#include<cstdio>

long long k[69];

int main()

{

k[0] = 1;

k[1] = 1;

k[2] = 2;

k[3] = 4;

for (int i = 4; i < 69; ++i)

k[i] = k[i - 1] + k[i - 2] + k[i - 3] + k[i - 4];

int t, n;

for (scanf("%d", &t); t--;)

{

scanf("%d", &n);

printf("%lld\n", k[n]);

}

}

'백준 > 백준-C++' 카테고리의 다른 글

11816번: 8진수, 10진수, 16진수  (0) 2017.06.04
6359번: 만취한 상범  (0) 2017.06.04
9466번: 텀 프로젝트  (0) 2017.06.04
1012번: 유기농 배추  (0) 2017.06.03
1629번: 곱셈  (0) 2017.06.03
Comments