2012021-02-06 14:04:45Molnár AttilaToronyépítés (1,1,3,3)python3Runtime error 38/50182ms39820 KiB
from sys import stdin, stdout
def main():
    n = int(stdin.readline())

    l=[]
    l.append(1)
    l.append(2)
    l.append(4)
    for i in range(3,n+1):
        l.append(2*(l[i-1]+l[i-3])%20210108)

#    for e in l:
#        print(e, end=" ")
#    print('')

    stdout.write(str(l[n])+'\n')

main()
SubtaskSumTestVerdictTimeMemory
base38/50
1Accepted0/037ms13344 KiB
2Accepted0/029ms13316 KiB
3Accepted3/328ms13248 KiB
4Accepted3/328ms13216 KiB
5Accepted4/428ms13248 KiB
6Accepted4/428ms13328 KiB
7Runtime error0/4182ms39776 KiB
8Accepted4/468ms22832 KiB
9Accepted4/430ms13236 KiB
10Accepted4/428ms13260 KiB
11Accepted4/493ms29180 KiB
12Runtime error0/4162ms39736 KiB
13Runtime error0/4158ms39820 KiB
14Accepted4/4160ms39772 KiB
15Accepted2/228ms13328 KiB
16Accepted2/227ms13244 KiB