Need help: Anthony and Cora — Kattis

Revision en3, by yassin_, 2017-10-01 17:51:18

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, the loser gets 1 point subtracted.

I can only think of dp in O((N+M)*N*M), but it gets TLE

my code

Any help is appreciated :)

Tags kattis, anthony, probability, dp?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en4 English yassin_ 2017-10-01 18:03:37 9
en3 English yassin_ 2017-10-01 17:51:18 0 (published)
en2 English yassin_ 2017-10-01 17:42:41 36 Tiny change: 'ound $p_i$\n\nI can ' -> 'ound $p_i$, the loser gets 1 point subtracted.\n\nI can ' (saved to drafts)
en1 English yassin_ 2017-10-01 17:39:27 1091 Initial revision (published)