3732021-11-03 08:14:00AlmafaToronyépítés (1,1,3,3)cpp11Wrong answer 43/5014ms9500 KiB
#include <iostream>
#include <vector>

using namespace std;

int main()
{
    int M;
    cin >> M;

    vector<int> dolgok(M+1);

    dolgok[0] = 0;
    dolgok[1] = 2;
    dolgok[2] = 4;
    dolgok[3] = 10;

    if (M  < 4)
    {
        cout << M << " - " << dolgok[M];
    }

    for (size_t i = 4; i <= M; i++)
    {
        dolgok[i] = (2 * dolgok[i - 1] + 2 * dolgok[i - 3]) % 20210108;
    }

    cout << dolgok[M];
}
SubtaskSumTestVerdictTimeMemory
base43/50
1Accepted0/02ms1740 KiB
2Accepted0/01ms1784 KiB
3Accepted3/31ms1840 KiB
4Wrong answer0/31ms1844 KiB
5Accepted4/41ms1856 KiB
6Accepted4/41ms1860 KiB
7Accepted4/412ms9476 KiB
8Accepted4/43ms2592 KiB
9Accepted4/41ms1864 KiB
10Accepted4/41ms1872 KiB
11Accepted4/44ms3256 KiB
12Accepted4/414ms9500 KiB
13Accepted4/410ms8464 KiB
14Accepted4/44ms4304 KiB
15Wrong answer0/21ms1888 KiB
16Wrong answer0/21ms1892 KiB