37482023-03-02 18:35:14Erik_GepardToronyépítés (1,1,3,3)cpp17Wrong answer 45/508ms3884 KiB
#include <bits/stdc++.h>
using namespace std;

const int mod = 20210108;

void solve(){
    int n;
    cin>>n;
    vector<int> dp(10);
    dp[0]=0;
    dp[1]=2;
    dp[2]=4;
    dp[3]=10;
    for(int i=4; i<=n; i++){
        dp[4]=(dp[3]*2+dp[1]*2)%mod;
        dp[0]=dp[1]%mod;
        dp[1]=dp[2]%mod;
        dp[2]=dp[3]%mod;
        dp[3]=dp[4]%mod;
    }
    cout<<dp[3]%mod;
}

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    solve();
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base45/50
1Accepted0/03ms1832 KiB
2Accepted0/03ms2032 KiB
3Accepted3/33ms2260 KiB
4Wrong answer0/32ms2336 KiB
5Accepted4/43ms2608 KiB
6Accepted4/43ms2816 KiB
7Accepted4/48ms3304 KiB
8Accepted4/43ms3332 KiB
9Accepted4/42ms3348 KiB
10Accepted4/43ms3424 KiB
11Accepted4/44ms3492 KiB
12Accepted4/48ms3576 KiB
13Accepted4/48ms3796 KiB
14Accepted4/44ms3884 KiB
15Accepted2/22ms3880 KiB
16Wrong answer0/22ms3884 KiB