32882023-02-24 08:42:59PallanekPéterToronyépítés (80 pont)python3Time limit exceeded 50/80185ms39980 KiB
def main():
    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])
main()
SubtaskSumTestVerdictTimeMemory
base50/80
1Accepted0/017ms11184 KiB
2Accepted0/017ms11300 KiB
3Accepted4/417ms11340 KiB
4Accepted4/417ms11608 KiB
5Accepted5/517ms11696 KiB
6Accepted5/517ms12008 KiB
7Time limit exceeded0/6185ms24452 KiB
8Accepted6/661ms22124 KiB
9Accepted7/717ms12528 KiB
10Accepted7/717ms12324 KiB
11Accepted8/887ms28872 KiB
12Time limit exceeded0/8180ms24460 KiB
13Time limit exceeded0/8163ms21844 KiB
14Time limit exceeded0/8140ms39980 KiB
15Accepted2/217ms13508 KiB
16Accepted2/217ms13116 KiB