37462023-03-02 18:30:35Erik_GepardToronyépítés (1,1,3,3)cpp17Wrong answer 45/5023ms4344 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];
        dp[1]=dp[2];
        dp[2]=dp[3];
        dp[3]=dp[4];
    }
    cout<<dp[3];
}

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    solve();
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base45/50
1Accepted0/03ms1824 KiB
2Accepted0/03ms2056 KiB
3Accepted3/32ms2268 KiB
4Wrong answer0/32ms2484 KiB
5Accepted4/43ms2712 KiB
6Accepted4/43ms2884 KiB
7Accepted4/423ms3112 KiB
8Accepted4/44ms3308 KiB
9Accepted4/43ms3520 KiB
10Accepted4/43ms3736 KiB
11Accepted4/47ms3952 KiB
12Accepted4/423ms4176 KiB
13Accepted4/419ms4244 KiB
14Accepted4/48ms4344 KiB
15Accepted2/22ms4320 KiB
16Wrong answer0/22ms4324 KiB