17302022-12-02 11:00:46bzsofiaToronyépítés (1,1,3,3)cpp11Runtime error 45/5020ms18468 KiB
#include <iostream>
#include <vector>

using namespace std;

long long 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]%20210108+2*x[i-3]%20210108)%20210108;
    }

    cout<<x[n];

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base45/50
1Accepted0/03ms1960 KiB
2Accepted0/02ms2204 KiB
3Accepted3/32ms2312 KiB
4Runtime error0/32ms2664 KiB
5Accepted4/42ms2820 KiB
6Accepted4/42ms2880 KiB
7Accepted4/420ms18420 KiB
8Accepted4/44ms4604 KiB
9Accepted4/42ms3008 KiB
10Accepted4/42ms3188 KiB
11Accepted4/44ms6000 KiB
12Accepted4/420ms18468 KiB
13Accepted4/417ms16988 KiB
14Accepted4/48ms8824 KiB
15Accepted2/22ms3780 KiB
16Runtime error0/22ms3760 KiB