122222024-12-09 17:33:18Firesloth28Toronyépítés (1,1,3,3)python3Time limit exceeded 42/50224ms3132 KiB
from sys import stdin, stdout

def main():
    n = int(stdin.readline())
    
    t = [2, 4, 10]
    
    if n <= 3:
        stdout.write(str(t[n - 1]))
        return

    for _ in range(4, n + 1):
        new_value = (t[2] * 2 + t[0] * 2) % 20210108
        t[0] = t[1]
        t[1] = t[2]
        t[2] = new_value
    
    stdout.write(str(t[2]))

main()
SubtaskSumTestVerdictTimeMemory
base42/50
1Accepted0/014ms3128 KiB
2Accepted0/016ms3128 KiB
3Accepted3/316ms3112 KiB
4Accepted3/316ms2872 KiB
5Accepted4/416ms3108 KiB
6Accepted4/416ms3092 KiB
7Time limit exceeded0/4224ms3100 KiB
8Accepted4/441ms3032 KiB
9Accepted4/416ms2872 KiB
10Accepted4/416ms3104 KiB
11Accepted4/457ms2920 KiB
12Time limit exceeded0/4224ms3128 KiB
13Accepted4/4199ms2872 KiB
14Accepted4/486ms3096 KiB
15Accepted2/214ms3132 KiB
16Accepted2/216ms2872 KiB