2032021-02-06 14:51:34kovacs.peter.18fToronyépítés (1,1,3,3)cpp11Accepted 50/5037ms26504 KiB
#include <iostream>
#include <vector>

using namespace std;

int main() {
    cin.sync_with_stdio(false);
    cin.tie(nullptr);

    int N;
    cin >> N;
    vector<long long> variationS { 1, 2, 4 };
    for (int i = 3; i <= N; i++) {
        variationS.push_back(2 * (variationS[i - 1] + variationS[i - 3]) % 20210108);
    }
    cout << variationS[N] << '\n';
}
SubtaskSumTestVerdictTimeMemory
base50/50
1Accepted0/02ms1760 KiB
2Accepted0/01ms1836 KiB
3Accepted3/32ms1860 KiB
4Accepted3/31ms1868 KiB
5Accepted4/41ms1864 KiB
6Accepted4/41ms1892 KiB
7Accepted4/437ms26496 KiB
8Accepted4/44ms5104 KiB
9Accepted4/41ms1904 KiB
10Accepted4/41ms1908 KiB
11Accepted4/46ms8096 KiB
12Accepted4/424ms26504 KiB
13Accepted4/424ms26464 KiB
14Accepted4/48ms8100 KiB
15Accepted2/21ms1928 KiB
16Accepted2/21ms1908 KiB