32852023-02-23 22:36:33PallanekPéterToronyépítés (80 pont)python3Time limit exceeded 42/80201ms28576 KiB
n=int(input())
dp=[1,3]; i=2
while i<=n:
    dp.append((dp[i-2]+dp[i-1]*3)%20210108)
    i+=1
print(dp[n])
SubtaskSumTestVerdictTimeMemory
base42/80
1Accepted0/017ms10988 KiB
2Accepted0/018ms11532 KiB
3Accepted4/417ms11392 KiB
4Accepted4/417ms11688 KiB
5Accepted5/517ms11624 KiB
6Accepted5/517ms11956 KiB
7Time limit exceeded0/6201ms19484 KiB
8Accepted6/682ms22092 KiB
9Accepted7/717ms12308 KiB
10Accepted7/717ms12520 KiB
11Time limit exceeded0/8120ms28576 KiB
12Time limit exceeded0/8170ms17676 KiB
13Time limit exceeded0/8170ms17796 KiB
14Time limit exceeded0/8153ms16400 KiB
15Accepted2/217ms12800 KiB
16Accepted2/217ms12780 KiB