23712023-01-11 20:01:13sztomiToronyépítés (2,2,3,3)cpp11Accepted 40/404ms6496 KiB
#include <bits/stdc++.h>

using namespace std;

typedef long long int ll;

const int MOD = 20210108;
const int MAXN = 200000;

ll dp[MAXN+1];

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(NULL);

    int n;
    cin >> n;

    dp[0] = 1;
    dp[1] = 0;
    for(int i = 2; i <= n; i++){
        dp[i] = (dp[i-2]*2 + dp[i-3]*2)%MOD;
    }
    cout << dp[n] << "\n";
}
SubtaskSumTestVerdictTimeMemory
base40/40
1Accepted0/03ms1896 KiB
2Accepted0/02ms2264 KiB
3Accepted2/22ms2420 KiB
4Accepted2/22ms2504 KiB
5Accepted3/32ms2572 KiB
6Accepted3/32ms2816 KiB
7Accepted3/34ms6104 KiB
8Accepted3/33ms4964 KiB
9Accepted3/32ms3252 KiB
10Accepted3/32ms3456 KiB
11Accepted3/34ms6496 KiB
12Accepted3/34ms6336 KiB
13Accepted4/44ms6256 KiB
14Accepted4/43ms5808 KiB
15Accepted2/22ms3664 KiB
16Accepted2/22ms3880 KiB