143162025-01-10 14:01:04buzaszendvicsToronyépítés (1,1,3,3)cpp11Runtime error 38/5037ms32000 KiB
#include <iostream>

using namespace std;

long long 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;
    long long 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/437ms32000 KiB
8Accepted4/410ms7096 KiB
9Accepted4/41ms316 KiB
10Accepted4/41ms316 KiB
11Accepted4/414ms11344 KiB
12Runtime error0/437ms32000 KiB
13Runtime error0/430ms32000 KiB
14Accepted4/424ms18756 KiB
15Accepted2/21ms316 KiB
16Accepted2/21ms316 KiB