32862023-02-23 22:45:07PallanekPéterToronyépítés (80 pont)python3Time limit exceeded 50/80179ms13024 KiB
def main():
    n=int(input())
    dp=[1,3,0]
    for i in range(n-1):
        dp[2]=dp[0]; dp[0]=dp[1]
        dp[1]=(dp[0]*3+dp[2])%20210108
    print(dp[1])
main()
SubtaskSumTestVerdictTimeMemory
base50/80
1Accepted0/017ms10912 KiB
2Accepted0/018ms11392 KiB
3Accepted4/417ms11480 KiB
4Accepted4/417ms11784 KiB
5Accepted5/517ms11804 KiB
6Accepted5/517ms11756 KiB
7Time limit exceeded0/6179ms4664 KiB
8Accepted6/652ms12192 KiB
9Accepted7/717ms12580 KiB
10Accepted7/717ms12644 KiB
11Accepted8/874ms12596 KiB
12Time limit exceeded0/8174ms5408 KiB
13Time limit exceeded0/8172ms5484 KiB
14Time limit exceeded0/8112ms13024 KiB
15Accepted2/217ms12892 KiB
16Accepted2/217ms12852 KiB