123992024-12-16 15:20:26mártonágnesToronyépítés (1,1,3,3)cpp17Accepted 50/509ms4160 KiB
#include <iostream>

using namespace std;

int main()
{
    int N;
    cin >> N;
    int a[N];
    a[1]=2;
    a[2]=4;
    a[3]=10;
    for (int i=4; i<=N; i++)
    {
        a[i]=(2*a[i-1]+2*a[i-3])%20210108;
    }
    cout << a[N];


    return 0;
}
SubtaskSumTestVerdictTimeMemory
base50/50
1Accepted0/01ms320 KiB
2Accepted0/01ms320 KiB
3Accepted3/31ms320 KiB
4Accepted3/31ms320 KiB
5Accepted4/41ms320 KiB
6Accepted4/41ms320 KiB
7Accepted4/49ms4152 KiB
8Accepted4/42ms824 KiB
9Accepted4/41ms320 KiB
10Accepted4/41ms508 KiB
11Accepted4/43ms1080 KiB
12Accepted4/49ms4160 KiB
13Accepted4/48ms3664 KiB
14Accepted4/44ms1592 KiB
15Accepted2/21ms320 KiB
16Accepted2/21ms320 KiB