32012023-02-22 13:06:0412BotiJardaTpython3Time limit exceeded 9/40273ms12132 KiB
def r(a, b):
    if a == 0 and b == 0:
        return 1
    if a < 0 or b < 0:
        return 0

    x = 0
    if a == b:
        x += r(a - 1, b - 1)
        x += r(a - 2, b - 1)
        x += r(a - 1, b - 2)
        x += r(a - 2, b - 0)
    elif a > b:
        return r(b, a)
    elif a == b - 1:
        x += r(a - 1, b - 2)
        x += r(a - 1, b - 3)
        x += r(a - 0, b - 2)
    elif a == b - 2:
        x += r(a - 0, b - 2)
    # print(f"r({a}, {b}) = {x}")
    return x % 20200111


N = int(input())
print(r(N, N))
SubtaskSumTestVerdictTimeMemory
base9/40
1Accepted0/018ms11148 KiB
2Time limit exceeded0/0248ms4064 KiB
3Accepted1/117ms11524 KiB
4Accepted1/117ms11580 KiB
5Accepted2/217ms12008 KiB
6Accepted2/217ms12128 KiB
7Accepted3/321ms12132 KiB
8Time limit exceeded0/3246ms4964 KiB
9Time limit exceeded0/3240ms4924 KiB
10Time limit exceeded0/3256ms4764 KiB
11Time limit exceeded0/3221ms5080 KiB
12Time limit exceeded0/3273ms5284 KiB
13Time limit exceeded0/3256ms5316 KiB
14Time limit exceeded0/3261ms5376 KiB
15Time limit exceeded0/3252ms5632 KiB
16Time limit exceeded0/3261ms5608 KiB
17Time limit exceeded0/4254ms5664 KiB