59882023-10-11 16:10:46Tina0731Toronyépítés (1,1,3,3)cpp14Runtime error 48/5013ms18684 KiB
#include <iostream>

using namespace std;

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


    t[1]=2;
    t[2]=4;
    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
base48/50
1Accepted0/03ms1880 KiB
2Accepted0/03ms2016 KiB
3Accepted3/33ms2228 KiB
4Accepted3/33ms2352 KiB
5Accepted4/43ms2568 KiB
6Accepted4/42ms2780 KiB
7Accepted4/413ms18596 KiB
8Accepted4/44ms4920 KiB
9Accepted4/42ms3200 KiB
10Accepted4/43ms3316 KiB
11Accepted4/44ms6432 KiB
12Accepted4/413ms18684 KiB
13Accepted4/410ms16920 KiB
14Accepted4/46ms8744 KiB
15Accepted2/23ms3636 KiB
16Runtime error0/23ms3832 KiB