143152025-01-10 13:57:29buzaszendvicsToronyépítés (1,1,3,3)cpp11Runtime error 38/5035ms32000 KiB
#include <iostream>

using namespace std;

int tar[1000001];


int toronyepites(int n)
{
    if (!tar[n]) tar[n] = ((toronyepites(n-1) + toronyepites(n-3))*2)%20210108;
    return tar[n];
}

int main()
{
    tar[0] = 1;
    tar[1] = 2;
    tar[2] = 4;
    int n;
    cin >> n;
    cout << toronyepites(n);
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base38/50
1Accepted0/01ms316 KiB
2Accepted0/01ms316 KiB
3Accepted3/31ms316 KiB
4Accepted3/31ms316 KiB
5Accepted4/41ms316 KiB
6Accepted4/41ms316 KiB
7Runtime error0/435ms32000 KiB
8Accepted4/49ms6480 KiB
9Accepted4/41ms316 KiB
10Accepted4/41ms316 KiB
11Accepted4/414ms10444 KiB
12Runtime error0/429ms32000 KiB
13Runtime error0/435ms32000 KiB
14Accepted4/423ms17516 KiB
15Accepted2/21ms316 KiB
16Accepted2/21ms316 KiB