7512022-01-07 11:50:50rmlanToronyépítés (1,1,3,3)cpp14Runtime error 48/5014ms17604 KiB
#include<bits/stdc++.h>
#define fi first
#define se second
#define m_p make_pair
#define ll long long
#define int long long
#define tc int _TC_; cin >> _TC_; while(_TC_--)
using namespace std;
typedef pair<int,int> pi;

signed main(){
    int n;
    cin >> n;
    int er[n+1]={};
    er[1]=2;
    er[2]=4;
    er[3]=10;
    for(int i = 4; i <= n; i++){
        er[i]=er[i-1]*2+er[i-3]*2;


        er[i] %= 20210108;
    }
    cout << er[n];
}

SubtaskSumTestVerdictTimeMemory
base48/50
1Accepted0/02ms1880 KiB
2Accepted0/01ms1904 KiB
3Accepted3/31ms1956 KiB
4Accepted3/31ms1952 KiB
5Accepted4/41ms1964 KiB
6Accepted4/41ms1968 KiB
7Accepted4/414ms17604 KiB
8Accepted4/43ms3836 KiB
9Accepted4/41ms1972 KiB
10Accepted4/41ms1988 KiB
11Accepted4/44ms5100 KiB
12Accepted4/414ms17424 KiB
13Accepted4/414ms15684 KiB
14Accepted4/46ms7260 KiB
15Accepted2/21ms1996 KiB
16Runtime error0/22ms2016 KiB