75062024-01-09 11:44:26AblablablaToronyépítés (1,1,3,3)cpp17Accepted 50/5014ms18772 KiB
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const ll MOD = 20210108;

int main()
{
    int n;
    cin >> n;

    vector<ll> dp(n + 1, 1);

    for(int i = 1; i <= n; i++){
        dp[i] = (2 * (i > 0 ? dp[i - 1] : 0) + 2 * (i > 2 ? dp[i - 3] : 0)) % MOD;
    }

    cout << dp[n] << "\n";
}
SubtaskSumTestVerdictTimeMemory
base50/50
1Accepted0/03ms1808 KiB
2Accepted0/03ms2076 KiB
3Accepted3/33ms2224 KiB
4Accepted3/33ms2460 KiB
5Accepted4/43ms2580 KiB
6Accepted4/43ms2532 KiB
7Accepted4/414ms18296 KiB
8Accepted4/44ms4988 KiB
9Accepted4/43ms3080 KiB
10Accepted4/43ms3212 KiB
11Accepted4/44ms6240 KiB
12Accepted4/414ms18772 KiB
13Accepted4/414ms17152 KiB
14Accepted4/47ms8816 KiB
15Accepted2/23ms3944 KiB
16Accepted2/23ms3936 KiB