DP K
Competitive Game Read-Out Issues
DP with the board as the domain of definition
The board can be represented by a single integer.
The value is "the person who is handed the board wins or loses."
Tracing backwards from the end of the game where there is nothing left to take and you lose.
code:python
def solve(N, K, AS):
AS.sort()
for i in range(MIN):
for i in range(MIN, K + 1):
for a in AS:
break
else:
# debug(": table", table)
return "First"
else:
return "Second"
---
This page is auto-translated from /nishio/DP K. If you looks something interesting but the auto-translated English is not good enough to understand it, feel free to let me know at @nishio_en. I'm very happy to spread my thought to non-Japanese readers.