PAST2I
https://gyazo.com/edc8d1afb55b0c9082e68b8470ffa0e0
PAST2I
If you know your opponent's ID, you know if you win or lose by a constant order of magnitude.
So just queue up the first round winner ID and read it in the second round.
While len(winner) > 2` since there is no need to do a final.
code:python
def solve(N, AS):
winner = list(range(2 ** N))
next_rank = 2
while len(winner) > 2:
next_winner = []
for i in range(0, len(winner), 2):
next_winner.append(a)
else:
next_winner.append(b)
winner = next_winner
next_rank += 1
return ranks
---
This page is auto-translated from /nishio/PAST2I. 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.