How to solve the problem H — Prefix Game? I came up with a logic, but it gives a wrong answer. Can anyone help me correct it?
I am mainly focusing on the "gap" condition, where v[i] — v[i+1] > 1, or v[i] == v[i-1].
I treat such cases as gaps, and according to my observation, the player who encounters the first gap wins the game. Can someone explain why this logic fails or how it can be corrected?
How to solve the problem H — Prefix Game? I came up with a logic, but it gives a wrong answer. Can anyone help me correct it?
I am mainly focusing on the "gap" condition, where v[i] — v[i+1] > 1, or v[i] == v[i-1].
I treat such cases as gaps, and according to my observation, the player who encounters the first gap wins the game. Can someone explain why this logic fails or how it can be corrected?