36982023-03-02 11:17:21MatematikaToronyépítés (80 pont)cpp17Accepted 80/808ms4168 KiB
#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n;
    cin >> n;
    int megoldas=1;
    int elozo=1;
    int azelotti=0;
    for(int i=0; i<n; i++)
    {
        megoldas=(elozo*3+azelotti)%20210108;
        azelotti=elozo%20210108;
        elozo=megoldas;
    }
    cout << megoldas;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base80/80
1Accepted0/03ms1872 KiB
2Accepted0/02ms2120 KiB
3Accepted4/43ms2372 KiB
4Accepted4/42ms2532 KiB
5Accepted5/53ms2712 KiB
6Accepted5/53ms2948 KiB
7Accepted6/68ms3164 KiB
8Accepted6/63ms3376 KiB
9Accepted7/72ms3460 KiB
10Accepted7/72ms3732 KiB
11Accepted8/84ms3864 KiB
12Accepted8/88ms3948 KiB
13Accepted8/88ms3972 KiB
14Accepted8/84ms4092 KiB
15Accepted2/22ms4108 KiB
16Accepted2/23ms4168 KiB