80492024-01-12 11:28:51gyjazminToronyépítés (1,1,3,3)cpp17Runtime error 45/5014ms18128 KiB

#include <iostream>
#include <vector>
using namespace std;
typedef long long ll;
int main()
{
    int n;
    cin >> n;
    vector<ll> torony(n+1);
    torony[0] = 0;
    torony[1] = 2;
    torony[2] = 4;
    torony[3] = 10;
    for (int i = 4;i <= n;i++) {
        torony[i] = (2*torony[i - 1]+2*torony[i - 3])% 20210108;
    }
    cout << torony[n] << endl;
}

SubtaskSumTestVerdictTimeMemory
base45/50
1Accepted0/03ms1808 KiB
2Accepted0/03ms2168 KiB
3Accepted3/33ms2220 KiB
4Runtime error0/33ms2284 KiB
5Accepted4/43ms2312 KiB
6Accepted4/43ms2304 KiB
7Accepted4/414ms18104 KiB
8Accepted4/44ms4272 KiB
9Accepted4/43ms2540 KiB
10Accepted4/43ms2664 KiB
11Accepted4/44ms5592 KiB
12Accepted4/414ms18128 KiB
13Accepted4/414ms16676 KiB
14Accepted4/47ms8088 KiB
15Accepted2/23ms3120 KiB
16Runtime error0/23ms3068 KiB