69302023-12-20 10:23:29szabelrToronyépítés (1,1,3,3)cpp17Accepted 50/5012ms11168 KiB
#include <iostream>

using namespace std;

int main()
{
    int n;
    cin>>n;
    int tomb[n+1];
    tomb[1]=2;
    tomb[2]=4;
    tomb[3]=10;
    for(int i=4; i<=n; i++){
        tomb[i]=((tomb[i-1]+tomb[i-3])*2)%20210108;
    }
    cout<<tomb[n];
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base50/50
1Accepted0/03ms1876 KiB
2Accepted0/03ms2124 KiB
3Accepted3/33ms2336 KiB
4Accepted3/33ms2368 KiB
5Accepted4/43ms2624 KiB
6Accepted4/43ms2560 KiB
7Accepted4/410ms10444 KiB
8Accepted4/44ms3768 KiB
9Accepted4/43ms2920 KiB
10Accepted4/43ms3052 KiB
11Accepted4/44ms4832 KiB
12Accepted4/412ms11168 KiB
13Accepted4/49ms10304 KiB
14Accepted4/46ms6324 KiB
15Accepted2/23ms3592 KiB
16Accepted2/23ms3648 KiB