123522024-12-13 07:22:46KissCsongor777Toronyépítés (1,1,3,3)cpp17Accepted 50/509ms4248 KiB
#include <iostream>

using namespace std;
int H[1000001];
int main()
{
    int n;
    cin>>n;
    H[1]=2;H[2]=4;H[3]=10;
    for(int i=4;i<=n;i++)
    H[i]=(2*H[i-1]+2*H[i-3])%20210108;
    cout<<H[n];
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base50/50
1Accepted0/01ms320 KiB
2Accepted0/01ms512 KiB
3Accepted3/31ms500 KiB
4Accepted3/31ms320 KiB
5Accepted4/41ms320 KiB
6Accepted4/41ms400 KiB
7Accepted4/49ms4248 KiB
8Accepted4/42ms824 KiB
9Accepted4/41ms320 KiB
10Accepted4/41ms320 KiB
11Accepted4/42ms1080 KiB
12Accepted4/48ms4224 KiB
13Accepted4/48ms3640 KiB
14Accepted4/44ms1580 KiB
15Accepted2/21ms320 KiB
16Accepted2/21ms320 KiB