Skip to content

Instantly share code, notes, and snippets.

@niklasjang
Created April 15, 2020 11:14
Show Gist options
  • Save niklasjang/4dc64a92bff9a32b25f666f352e9b082 to your computer and use it in GitHub Desktop.
Save niklasjang/4dc64a92bff9a32b25f666f352e9b082 to your computer and use it in GitHub Desktop.
[PS][DP]/[BOJ][11727][2*n타일링2]
#include <iostream>
using namespace std;
int n = 0;
int dp[1001] = { 0 };
int main(void) {
int n = 0;
cin >> n;
dp[1] = 1;
dp[2] = 3;
for (int i = 3; i <= n; i++) {
dp[i] = (dp[i - 1] + dp[i - 2]*2) % 10007;
}
cout << dp[n];
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment