//https://www.acmicpc.net/problem/9507 |
#include <iostream> |
using namespace std; |
long long koong[68]; |
int main() |
{ |
int t; |
cin >> t; |
for(int i=0; i<t; i++) |
{ |
int n; |
cin>>n; |
for(int j=0; j<=n; j++) |
{ |
if(koong[j]>0) continue; |
if(j<2) koong[j]=1; |
else if(j==2) koong[j]=2; |
else if(j==3) koong[j]=4; |
else koong[j]=koong[j-1]+koong[j-2]+koong[j-3]+koong[j-4]; |
} |
cout << koong[n] << endl; |
} |
} |
'알고리즘 문제 풀이 > 1DP_과제(~180615)' 카테고리의 다른 글
180123_11057_오르막수 (0) | 2018.01.23 |
---|---|
180122_1977_완전제곱수 (0) | 2018.01.22 |
180120_3034_앵그리 창영 (0) | 2018.01.20 |
180119_1159_농구경기 (0) | 2018.01.19 |
180106_3143_가장 빠른 문자열 타이핑 (0) | 2018.01.06 |