9762022-02-07 20:15:24HobimmToronyépítés (80 pont)cpp11Accepted 80/8013ms17608 KiB
#include <bits/stdc++.h>
#define ll long long
using namespace std;

int main()
{
    int n;
    cin >> n;
    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;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base80/80
1Accepted0/02ms1872 KiB
2Accepted0/01ms1916 KiB
3Accepted4/41ms1972 KiB
4Accepted4/41ms1972 KiB
5Accepted5/51ms1980 KiB
6Accepted5/51ms1980 KiB
7Accepted6/613ms17608 KiB
8Accepted6/62ms3848 KiB
9Accepted7/71ms1996 KiB
10Accepted7/71ms1996 KiB
11Accepted8/83ms5112 KiB
12Accepted8/812ms17404 KiB
13Accepted8/810ms15628 KiB
14Accepted8/84ms7204 KiB
15Accepted2/21ms2016 KiB
16Accepted2/21ms2020 KiB