I am stuck on this problem
Basically: p1 has N points, p2 has M points. They play N + M - 1 rounds. N, M ≤ 1000. The player who gets zero first loses.
p1 knows the probability of winning each round pi
I can only think of dp in O((N+M)*N*M), but it gets TLE
my code
Any help is appreciated :)