Need help: Anthony and Cora — Kattis

Правка en2, от yassin_, 2017-10-01 17:42:41

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 :)

Теги kattis, anthony, probability, dp?

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en4 Английский yassin_ 2017-10-01 18:03:37 9
en3 Английский yassin_ 2017-10-01 17:51:18 0 (published)
en2 Английский 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 Английский yassin_ 2017-10-01 17:39:27 1091 Initial revision (published)