30542023-02-09 14:05:05DalmToronyépítés (80 pont)cpp11Accepted 80/8012ms11488 KiB
#include <iostream>

using namespace std;

int main()
{
    int N;
    cin>>N;
    int variaciok[N+1];
    variaciok[0]=1;
    variaciok[1]=3;
    for(int i=2;i<=N;i++){
        variaciok[i]=(3*variaciok[i-1]+1*variaciok[i-2])%20210108;
    }
    cout<<variaciok[N];
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base80/80
1Accepted0/03ms1876 KiB
2Accepted0/03ms2124 KiB
3Accepted4/43ms2284 KiB
4Accepted4/43ms2524 KiB
5Accepted5/53ms2708 KiB
6Accepted5/53ms2932 KiB
7Accepted6/610ms11004 KiB
8Accepted6/63ms4080 KiB
9Accepted7/73ms3216 KiB
10Accepted7/73ms3492 KiB
11Accepted8/84ms5116 KiB
12Accepted8/812ms11488 KiB
13Accepted8/89ms10596 KiB
14Accepted8/84ms6464 KiB
15Accepted2/23ms3908 KiB
16Accepted2/23ms4116 KiB