[BOJ] 11727 2*N 타일링2

Time Lapse :33min 34sec

11727.cpp

1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <iostream>
#include <memory.h>
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]*2)%10007;
}
cout<<DP[N]<<endl;
}
Author: Song Hayoung
Link: https://songhayoung.github.io/2020/07/23/PS/BOJ/11727/
Copyright Notice: All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.