1162021-01-14 07:23:26kismartongToronyépítés (1,1,3,3)cpp11Accepted 50/5017ms10200 KiB
#include <bits/stdc++.h>
using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin >> n;

    vector<int> t;
    t.push_back(1);
    t.push_back(2);
    t.push_back(4);
    for (int i = 3; i <= n+1; i++) {
        t.push_back((2*t[i-1]+2*t[i-3])%20210108);
    }
    cout << t[n];
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base50/50
1Accepted0/01ms1756 KiB
2Accepted0/01ms1800 KiB
3Accepted3/31ms1852 KiB
4Accepted3/31ms1856 KiB
5Accepted4/41ms1860 KiB
6Accepted4/41ms1884 KiB
7Accepted4/417ms10148 KiB
8Accepted4/43ms3028 KiB
9Accepted4/41ms1872 KiB
10Accepted4/41ms1880 KiB
11Accepted4/44ms3940 KiB
12Accepted4/417ms10164 KiB
13Accepted4/417ms10200 KiB
14Accepted4/47ms5968 KiB
15Accepted2/21ms1896 KiB
16Accepted2/21ms1900 KiB