8032022-01-16 13:27:16Halasz EszterToronyépítés (1,1,3,3)cpp11Wrong answer 43/5064ms1956 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=4;
        b=10;
        c=24;
        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
base43/50
1Accepted0/01ms1804 KiB
2Accepted0/01ms1848 KiB
3Accepted3/31ms1908 KiB
4Wrong answer0/31ms1908 KiB
5Accepted4/41ms1912 KiB
6Accepted4/41ms1916 KiB
7Accepted4/464ms1924 KiB
8Accepted4/48ms1928 KiB
9Accepted4/41ms1932 KiB
10Accepted4/41ms1940 KiB
11Accepted4/413ms1940 KiB
12Accepted4/461ms1948 KiB
13Accepted4/464ms1944 KiB
14Accepted4/421ms1952 KiB
15Wrong answer0/21ms1956 KiB
16Wrong answer0/21ms1952 KiB