145502025-01-15 07:53:03TortelliniJrToronyépítés (80 pont)cpp17Accepted 80/8014ms8236 KiB
#include <iostream>
#include <vector>
using namespace std;
int main()
{
    int n;
    cin >> n;
    vector<long long int> a(n);
    a[0] = 3;
    a[1] = 10;
    for (int i = 2; i < n; i++) {
        a[i] = (a[i - 2] + a[i - 1] * 3) % 20210108;
    }
    cout << a[n - 1] % 20210108;
}
SubtaskSumTestVerdictTimeMemory
base80/80
1Accepted0/01ms508 KiB
2Accepted0/01ms316 KiB
3Accepted4/41ms316 KiB
4Accepted4/41ms500 KiB
5Accepted5/51ms316 KiB
6Accepted5/51ms316 KiB
7Accepted6/613ms8236 KiB
8Accepted6/62ms1332 KiB
9Accepted7/71ms316 KiB
10Accepted7/71ms316 KiB
11Accepted8/83ms1844 KiB
12Accepted8/814ms8068 KiB
13Accepted8/813ms7176 KiB
14Accepted8/84ms2796 KiB
15Accepted2/21ms316 KiB
16Accepted2/21ms320 KiB