37192023-03-02 13:40:29herczegkatToronyépítés (80 pont)python3Time limit exceeded 48/80201ms38908 KiB
def main():
    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])
   
main()
SubtaskSumTestVerdictTimeMemory
base48/80
1Accepted0/017ms10848 KiB
2Accepted0/017ms11192 KiB
3Accepted4/417ms11348 KiB
4Accepted4/417ms11740 KiB
5Accepted5/517ms11784 KiB
6Accepted5/517ms11664 KiB
7Time limit exceeded0/6201ms32728 KiB
8Accepted6/652ms21608 KiB
9Accepted7/717ms12112 KiB
10Accepted7/717ms12336 KiB
11Accepted8/878ms28180 KiB
12Time limit exceeded0/8141ms26772 KiB
13Time limit exceeded0/8153ms27420 KiB
14Time limit exceeded0/8115ms38908 KiB
15Accepted2/217ms12400 KiB
16Runtime error0/217ms12600 KiB