96532024-02-23 18:01:26NagyLeoToronyépítés (1,1,3,3)python3Time limit exceeded 22/50300ms68084 KiB
import sys

sys.setrecursionlimit(10**9)

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
base22/50
1Accepted0/017ms11480 KiB
2Time limit exceeded0/0277ms5972 KiB
3Accepted3/318ms11964 KiB
4Accepted3/317ms12068 KiB
5Time limit exceeded0/4300ms4612 KiB
6Accepted4/423ms12544 KiB
7Runtime error0/445ms68084 KiB
8Runtime error0/450ms67584 KiB
9Accepted4/418ms13020 KiB
10Accepted4/417ms13212 KiB
11Runtime error0/450ms67332 KiB
12Runtime error0/443ms67056 KiB
13Runtime error0/450ms67016 KiB
14Runtime error0/450ms66856 KiB
15Accepted2/218ms13676 KiB
16Accepted2/217ms13704 KiB