0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-12-24 03:31:59 +00:00

P1990 覆盖墙壁

R44593612
This commit is contained in:
Baoshuo Ren 2021-01-03 21:38:43 +08:00 committed by Baoshuo Ren
parent 7ef2844a8e
commit 144492f9d4
Signed by: baoshuo
GPG Key ID: 70F90A673FB1AB68

View File

@ -0,0 +1,15 @@
#include <bits/stdc++.h>
using namespace std;
int n, dp[1000009];
int main() {
dp[1] = 1, dp[2] = 2, dp[3] = 5;
cin >> n;
for (int i = 4; i <= n; i++) {
dp[i] = (dp[i - 1] * 2 + dp[i - 3]) % 10000;
}
cout << dp[n] << endl;
return 0;
}