commit
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
a, b = map(int, input().split(" "))
|
||||
|
||||
memo = {}
|
||||
|
||||
|
||||
def win(i: int, j: int) -> bool:
|
||||
# print(f"kirby: {i}, {j}")
|
||||
if i < j:
|
||||
return win(j, i)
|
||||
|
||||
if j == 1:
|
||||
return True
|
||||
if j <= 0:
|
||||
return False
|
||||
if (i, j) in memo:
|
||||
return memo[(i, j)]
|
||||
|
||||
memo[(i, j)] = not win(i - 1, j) or not win(i, j - 1)
|
||||
return memo[(i, j)]
|
||||
|
||||
|
||||
if win(a, b):
|
||||
print("Kirby")
|
||||
else:
|
||||
print("Dedede")
|
||||
Reference in New Issue
Block a user