32232023-02-22 18:26:22baranyimarcellToronyépítés (80 pont)cpp17Accepted 80/8013ms11136 KiB
#include <iostream>
#include <vector>
using namespace std;

int main()
{
    int N;
    cin>>N;
    vector<int>ki(N);
    ki.resize(N);
    ki[0]=3;
    ki[1]=10;
    if (N>1)
    {
        for (int i=2; i<N; i++)
        {
            int ossz=3*ki[i-1]+ki[i-2];
            ossz%=20210108;
            ki[i]=ossz;
        }
    }
    cout<<ki[N-1]<<endl;
}
SubtaskSumTestVerdictTimeMemory
base80/80
1Accepted0/03ms1684 KiB
2Accepted0/03ms1932 KiB
3Accepted4/43ms2164 KiB
4Accepted4/43ms2344 KiB
5Accepted5/53ms2504 KiB
6Accepted5/52ms2580 KiB
7Accepted6/612ms10452 KiB
8Accepted6/64ms3688 KiB
9Accepted7/73ms2916 KiB
10Accepted7/73ms3272 KiB
11Accepted8/84ms4564 KiB
12Accepted8/813ms11136 KiB
13Accepted8/812ms10232 KiB
14Accepted8/86ms6024 KiB
15Accepted2/23ms3756 KiB
16Accepted2/23ms3900 KiB