59892023-10-11 16:14:26Tina0731Toronyépítés (1,1,3,3)cpp14Accepted 50/5016ms19452 KiB
#include <iostream>

using namespace std;

int main()
{
    long long int n;
    cin>>n;
    long long int t[n+1];



    t[1]=2;
    if(n+1>=3)
        t[2]=4;
    if(n+1>=3)
        t[3]=10;

    for(int i=4;i<=n;i++)
    {
        t[i]=(2*t[i-1]+2*t[i-3])%20210108;
    }


    cout<<t[n];

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base50/50
1Accepted0/03ms1744 KiB
2Accepted0/03ms2008 KiB
3Accepted3/33ms2204 KiB
4Accepted3/33ms2420 KiB
5Accepted4/43ms2632 KiB
6Accepted4/43ms2840 KiB
7Accepted4/414ms18624 KiB
8Accepted4/44ms5184 KiB
9Accepted4/42ms3412 KiB
10Accepted4/43ms3632 KiB
11Accepted4/44ms7084 KiB
12Accepted4/416ms19452 KiB
13Accepted4/414ms17648 KiB
14Accepted4/47ms9176 KiB
15Accepted2/23ms4012 KiB
16Accepted2/22ms4120 KiB