[BOJ] 11726 2*N 타일링

Time Lapse :5min 0sec

11726.cpp

1
2
3
4
5
6
7
8
9
10
11
12
13
#include <iostream>
using namespace std;
int main(void){
int N;
cin>>N;
int DP[N+1];
DP[0] = DP[1] = 1;
for(int i=2;i<=N;i++){
DP[i]=(DP[i-1]+DP[i-2])%10007;
}
cout<<DP[N]<<endl;
}

Author: Song Hayoung
Link: https://songhayoung.github.io/2020/07/23/PS/BOJ/11726/
Copyright Notice: All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.