108762024-04-17 13:39:2142Toronyépítés (80 pont)python3Time limit exceeded 50/80172ms39344 KiB
from sys import stdin
input=stdin.readline

mod=20210108

def main():
    N=int(input())
    s=[1,3,10]
    for i in range(N):
        s.append((3*s[-1]+s[-2])%mod)
    print(s[N])
        
main()
SubtaskSumTestVerdictTimeMemory
base50/80
1Accepted0/017ms11060 KiB
2Accepted0/017ms11496 KiB
3Accepted4/417ms11412 KiB
4Accepted4/417ms11668 KiB
5Accepted5/517ms11692 KiB
6Accepted5/517ms11724 KiB
7Time limit exceeded0/6166ms25384 KiB
8Accepted6/654ms21968 KiB
9Accepted7/717ms12072 KiB
10Accepted7/717ms12444 KiB
11Accepted8/878ms28504 KiB
12Time limit exceeded0/8138ms22272 KiB
13Time limit exceeded0/8172ms27632 KiB
14Time limit exceeded0/8118ms39344 KiB
15Accepted2/217ms13004 KiB
16Accepted2/217ms12888 KiB