37142023-03-02 13:37:25herczegkatToronyépítés (80 pont)python3Time limit exceeded 48/80184ms39252 KiB
n=int(input())
dp=(n+1)*[0]
dp[1]=3
dp[2]=10
for i in range(3, n+1):
    dp[i]=(dp[i-1]*3+dp[i-2])%20210108
print(dp[n])


SubtaskSumTestVerdictTimeMemory
base48/80
1Accepted0/017ms10876 KiB
2Accepted0/017ms11412 KiB
3Accepted4/417ms11352 KiB
4Accepted4/417ms11624 KiB
5Accepted5/517ms11664 KiB
6Accepted5/517ms11920 KiB
7Time limit exceeded0/6164ms24544 KiB
8Accepted6/667ms22116 KiB
9Accepted7/717ms12416 KiB
10Accepted7/717ms12328 KiB
11Accepted8/897ms28260 KiB
12Time limit exceeded0/8184ms26772 KiB
13Time limit exceeded0/8174ms25404 KiB
14Time limit exceeded0/8155ms39252 KiB
15Accepted2/217ms13036 KiB
16Runtime error0/217ms13184 KiB