32872023-02-23 22:54:49PallanekPéterToronyépítés (80 pont)cpp17Accepted 80/8010ms11244 KiB
#include <iostream>

int main(){
    int n; std::cin >> n;
    int dp[n];
    dp[0]=1; dp[1]=3;
    int i=2;
    while (i<n+1){
        dp[i]=(3*dp[i-1]+dp[i-2])%20210108;
        i++;
    }
    std::cout << dp[n];
}
SubtaskSumTestVerdictTimeMemory
base80/80
1Accepted0/03ms1876 KiB
2Accepted0/03ms2068 KiB
3Accepted4/43ms2180 KiB
4Accepted4/43ms2392 KiB
5Accepted5/53ms2644 KiB
6Accepted5/53ms2888 KiB
7Accepted6/610ms10712 KiB
8Accepted6/64ms4060 KiB
9Accepted7/73ms3116 KiB
10Accepted7/73ms3252 KiB
11Accepted8/84ms5020 KiB
12Accepted8/810ms11244 KiB
13Accepted8/89ms10552 KiB
14Accepted8/84ms6356 KiB
15Accepted2/23ms3896 KiB
16Accepted2/23ms4128 KiB