8022022-01-16 13:26:16Halasz EszterToronyépítés (1,1,3,3)cpp11Wrong answer 3/5059ms1964 KiB
#include <iostream>
//#include <fstream>

#define ll long long
using namespace std;

//ifstream cin("toronyepites1133.in");
//ofstream cout("toronyepites1133.out");

ll n,M=20210108,a,b,c,d,i;

int main()
{
    cin>>n;
    if(n==1) cout<<2;
    if(n==2) cout<<4;
    if(n==3) cout<<10;
    if(n==4) cout<<24;
    else
    {
        a=2;
        b=4;
        c=10;
        for(i=5;i<=n;++i)
        {
            d=((2*c%M)%M+(2*a%M)%M)%M;
            a=b%M;
            b=c%M;
            c=d%M;

        }
        cout<<d<<"\n";
    }
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base3/50
1Wrong answer0/02ms1820 KiB
2Wrong answer0/01ms1900 KiB
3Accepted3/31ms1904 KiB
4Wrong answer0/31ms1900 KiB
5Wrong answer0/41ms1912 KiB
6Wrong answer0/41ms1908 KiB
7Wrong answer0/459ms1920 KiB
8Wrong answer0/48ms1924 KiB
9Wrong answer0/41ms1928 KiB
10Wrong answer0/41ms1940 KiB
11Wrong answer0/413ms1936 KiB
12Wrong answer0/459ms1940 KiB
13Wrong answer0/452ms1944 KiB
14Wrong answer0/420ms1956 KiB
15Wrong answer0/21ms1952 KiB
16Wrong answer0/21ms1964 KiB