252932026-02-19 02:01:37999Toronyépítés (2,2,3,3)cpp17Accepted 40/403ms1844 KiB
// Source: https://usaco.guide/general/io

#include <bits/stdc++.h>
using namespace std;
#define int long long

const int MOD=20210108;

signed main() {
    int n;cin>>n;
    vector<int> dp(n+2);
    dp[0]=1;
    dp[2]=2;
    for(int i = 3;i<=n;i++){
        dp[i]=2*dp[i-2]+2*dp[i-3];
        dp[i]%=MOD;
    }cout<<dp[n];
}
SubtaskSumTestVerdictTimeMemory
base40/40
1Accepted0/01ms316 KiB
2Accepted0/01ms316 KiB
3Accepted2/21ms500 KiB
4Accepted2/21ms316 KiB
5Accepted3/31ms316 KiB
6Accepted3/31ms316 KiB
7Accepted3/33ms1844 KiB
8Accepted3/32ms1332 KiB
9Accepted3/31ms316 KiB
10Accepted3/31ms316 KiB
11Accepted3/33ms1844 KiB
12Accepted3/33ms1844 KiB
13Accepted4/43ms1588 KiB
14Accepted4/42ms1332 KiB
15Accepted2/21ms316 KiB
16Accepted2/21ms316 KiB