알맹이방
[11727] 2×n 타일링 2 - C++ 본문
#include<iostream>
using namespace std;
int main(){
int number;
cin>>number;
int arr[1001];
arr[0] = 1;
arr[1] = 3;
int result = 0;
for(int i = 2; i<number; i++){
arr[i] = (arr[i-2]*2 + arr[i-1])%10007;
}
cout<<arr[number-1];
}
Comments