96522024-02-23 18:00:27NagyLeoToronyépítés (1,1,3,3)python3Runtime error 22/50300ms14904 KiB
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/018ms11352 KiB
2Runtime error0/019ms13264 KiB
3Accepted3/317ms11820 KiB
4Accepted3/317ms11848 KiB
5Time limit exceeded0/4300ms4672 KiB
6Accepted4/423ms12584 KiB
7Runtime error0/419ms14564 KiB
8Runtime error0/418ms14484 KiB
9Accepted4/417ms12468 KiB
10Accepted4/417ms12492 KiB
11Runtime error0/419ms14632 KiB
12Runtime error0/418ms14904 KiB
13Runtime error0/418ms14432 KiB
14Runtime error0/418ms14736 KiB
15Accepted2/217ms13024 KiB
16Accepted2/217ms12956 KiB