/*
* @Description: To iterate is human, to recurse divine.
* @Autor: Recursion
* @Date: 2022-05-20 21:23:11
* @LastEditTime: 2022-05-20 21:30:28
*/
#include <bits/stdc++.h>
#define LL long long
using namespace std;
const int maxn = 1e6 + 10;
const int mod = 10000;
const int INF = 1e9 + 10;
const int N = 1e6;
LL dp[N];
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int n;
cin >> n;
dp[1] = 1;
dp[2] = 2;
dp[3] = 5;
dp[4] = 11;
for(int i = 4;i <= n;i ++)
dp[i] = dp[i - 3]%mod + 2*dp[i - 1]%mod;
cout << dp[n]%mod << endl;
return 0;
}
P1990 覆盖墙壁
最新推荐文章于 2024-07-22 15:43:53 发布