17292022-12-02 10:57:11bzsofiaToronyépítés (1,1,3,3)cpp11Runtime error 45/5016ms18596 KiB
#include <iostream>
#include <vector>

using namespace std;

int i, n;

int main()
{
    cin>>n;

    vector <long long> x(n+1);

    x[1]=2;
    x[2]=4;
    x[3]=10;
    for(i=4; i<=n; ++i)
    {
        x[i]=(2*x[i-1]+2*x[i-3])%20210108;
    }

    cout<<x[n];

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base45/50
1Accepted0/03ms1808 KiB
2Accepted0/02ms2232 KiB
3Accepted3/32ms2308 KiB
4Runtime error0/32ms2412 KiB
5Accepted4/42ms2336 KiB
6Accepted4/42ms2328 KiB
7Accepted4/416ms17984 KiB
8Accepted4/44ms4540 KiB
9Accepted4/42ms2948 KiB
10Accepted4/42ms3072 KiB
11Accepted4/44ms6188 KiB
12Accepted4/414ms18596 KiB
13Accepted4/413ms17116 KiB
14Accepted4/47ms8872 KiB
15Accepted2/22ms4036 KiB
16Runtime error0/22ms4088 KiB