96542024-02-23 18:02:12NagyLeoToronyépítés (1,1,3,3)python3Runtime error 0/5018ms13540 KiB
import sys

sys.setrecursionlimit(10**16)

def main():
    N = int(input())

    def torony(magassag):
        if magassag == 0:
            return 0
        if magassag == 1:
            return 2
        if magassag == 2:
            return 4
        if magassag == 3:
            return 8 + 2
        res = 0
        res += 2 * torony(magassag - 1)
        if magassag >= 3:
            res += 2 * torony(magassag - 3)
        return res % 20210108

    print(torony(N))


main()
SubtaskSumTestVerdictTimeMemory
base0/50
1Runtime error0/018ms11220 KiB
2Runtime error0/017ms11416 KiB
3Runtime error0/317ms11676 KiB
4Runtime error0/317ms11960 KiB
5Runtime error0/417ms12352 KiB
6Runtime error0/417ms12404 KiB
7Runtime error0/417ms12056 KiB
8Runtime error0/417ms12608 KiB
9Runtime error0/417ms12560 KiB
10Runtime error0/417ms13044 KiB
11Runtime error0/417ms13092 KiB
12Runtime error0/417ms13248 KiB
13Runtime error0/417ms13124 KiB
14Runtime error0/417ms13392 KiB
15Runtime error0/217ms13428 KiB
16Runtime error0/217ms13540 KiB