Skip to content

Instantly share code, notes, and snippets.

@niklasjang
Created April 15, 2020 11:04
Show Gist options
  • Save niklasjang/00e59a8532460a15c67eaeb762824aaf to your computer and use it in GitHub Desktop.
Save niklasjang/00e59a8532460a15c67eaeb762824aaf to your computer and use it in GitHub Desktop.
[PS][DP]/[BOJ][11726][2*n타일링]
#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] = 2;
for (int i = 3; i <= n; i++) {
dp[i] = (dp[i - 1] + dp[i - 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