mirror of
https://hub.njuu.cf/TheAlgorithms/Python.git
synced 2023-10-11 13:06:12 +08:00
11 lines
272 B
Plaintext
11 lines
272 B
Plaintext
|
def count(n):
|
||
|
if (n & 1):
|
||
|
return 0
|
||
|
val = n // 2
|
||
|
dy_lst = [1 for i in range(val + 1)]
|
||
|
for i in range(2, val + 1):
|
||
|
dy_lst[i] = 0
|
||
|
for j in range(i):
|
||
|
dy_lst[i] += (dy_lst[j] * dy_lst[i - j - 1])
|
||
|
return dy_lst[val]
|