235432026-01-24 14:58:37BoldizsárToronyépítés (80 pont)cpp17Accepted 80/8014ms8244 KiB
#include <bits/stdc++.h>
using namespace std;

int main() {
	int n;cin >> n;
    vector<long long>dp(n+1);
    dp[1]= 3;dp[0]= 1;
    for(int i = 2;i <=n;i++){
        dp[i]=(dp[i-1]*3+dp[i-2])%20210108;
    }
    cout << dp[n];
}
SubtaskSumTestVerdictTimeMemory
base80/80
1Accepted0/01ms316 KiB
2Accepted0/01ms528 KiB
3Accepted4/41ms316 KiB
4Accepted4/41ms316 KiB
5Accepted5/51ms316 KiB
6Accepted5/52ms316 KiB
7Accepted6/614ms8244 KiB
8Accepted6/63ms1348 KiB
9Accepted7/71ms316 KiB
10Accepted7/71ms316 KiB
11Accepted8/84ms1844 KiB
12Accepted8/814ms8152 KiB
13Accepted8/813ms7272 KiB
14Accepted8/86ms3048 KiB
15Accepted2/21ms316 KiB
16Accepted2/21ms500 KiB