Created
April 15, 2020 11:14
-
-
Save niklasjang/4dc64a92bff9a32b25f666f352e9b082 to your computer and use it in GitHub Desktop.
[PS][DP]/[BOJ][11727][2*n타일링2]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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