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

#define ll long long
ll mod=20210108;

void solve(){
    ll n;
    cin>>n;
    vector<ll> 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/03ms1696 KiB
2Accepted0/03ms1876 KiB
3Accepted3/33ms2084 KiB
4Wrong answer0/32ms2304 KiB
5Accepted4/42ms2524 KiB
6Accepted4/42ms2588 KiB
7Accepted4/439ms2820 KiB
8Accepted4/47ms3032 KiB
9Accepted4/43ms3260 KiB
10Accepted4/42ms3312 KiB
11Accepted4/49ms3552 KiB
12Accepted4/439ms3632 KiB
13Accepted4/435ms3660 KiB
14Accepted4/414ms3636 KiB
15Accepted2/22ms3636 KiB
16Wrong answer0/23ms3768 KiB