67722023-12-19 08:59:28madvirToronyépítés (1,1,3,3)cpp17Wrong answer 45/5014ms19300 KiB
#include <iostream>

using namespace std;

int main()
{
    int n, x;
    cin >> n;
    long long a[n];
    a[0]=2;
    a[1]=4;
    a[2]=10;
    x=3;
    while(x<n) {
        a[x]=(2*a[x-1]+2*a[x-3])%20210108;
        x++;
    }
    cout << a[--x];

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base45/50
1Accepted0/03ms1876 KiB
2Accepted0/03ms2140 KiB
3Accepted3/33ms2332 KiB
4Wrong answer0/33ms2576 KiB
5Accepted4/43ms2660 KiB
6Accepted4/43ms2732 KiB
7Accepted4/414ms18564 KiB
8Accepted4/44ms5148 KiB
9Accepted4/43ms3616 KiB
10Accepted4/43ms3576 KiB
11Accepted4/44ms6796 KiB
12Accepted4/414ms19300 KiB
13Accepted4/413ms17744 KiB
14Accepted4/46ms9620 KiB
15Accepted2/23ms4472 KiB
16Wrong answer0/23ms4512 KiB