214232026-01-13 08:03:39kviviToronyépítés (80 pont)cpp17Accepted 80/809ms4224 KiB
#include <iostream>

using namespace std;

int main()
{
   int n, i;
   cin >> n;
    int t[n];
    t[0]=3;
    t[1]=10;
    for (i=2; i<=n-1; i++)
    {
        t[i]=(t[i-1]*3+t[i-2])%20210108;

    }
    cout << t[n-1];

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base80/80
1Accepted0/01ms316 KiB
2Accepted0/01ms316 KiB
3Accepted4/41ms316 KiB
4Accepted4/41ms316 KiB
5Accepted5/51ms316 KiB
6Accepted5/51ms316 KiB
7Accepted6/69ms4224 KiB
8Accepted6/62ms836 KiB
9Accepted7/71ms316 KiB
10Accepted7/71ms508 KiB
11Accepted8/83ms1076 KiB
12Accepted8/89ms4148 KiB
13Accepted8/88ms3636 KiB
14Accepted8/84ms1588 KiB
15Accepted2/21ms316 KiB
16Accepted2/21ms316 KiB