36672023-03-02 10:27:09DalmaToronyépítés (80 pont)cpp17Wrong answer 78/808ms3376 KiB
#include <iostream>

using namespace std;

int main()
{
    int N;
    cin >> N;
    long long x[2];
    x[0]=1;
    x[1]=3;
    long long megoldas;
    for (int i=1; i<N; i++)
    {
        megoldas=((x[1]*3)+x[0])%20210108;
        x[0]=x[1];
        x[1]=megoldas;
    }
    cout << megoldas << endl;
    //1: 3 - 2: 10 - 3: 33 - 4: 109
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base78/80
1Accepted0/03ms1872 KiB
2Accepted0/03ms2124 KiB
3Accepted4/43ms2332 KiB
4Accepted4/43ms2580 KiB
5Accepted5/52ms2760 KiB
6Accepted5/52ms2844 KiB
7Accepted6/68ms2956 KiB
8Accepted6/63ms2964 KiB
9Accepted7/72ms2848 KiB
10Accepted7/73ms3000 KiB
11Accepted8/84ms3084 KiB
12Accepted8/88ms3004 KiB
13Accepted8/87ms2996 KiB
14Accepted8/84ms2996 KiB
15Accepted2/23ms3376 KiB
16Wrong answer0/23ms3332 KiB