Блог пользователя pritishn

Автор pritishn, 4 года назад, По-английски

Problem Link:https://mirror.codeforces.com/problemset/problem/442/B

I have been trying to solve it using DP, but there always seems to be precision issues even when using long double.

My submissions : https://mirror.codeforces.com/contest/442/submission/81584010

In my approach
dp[i].first = the max probabilty obtainable by choosing 1 or more friends from index i to n-1.
dp[i].second = the product of complements of probablity of all chosen friends.
dp[i].second is helping me do the transition.

Can anyone solve it using such DP without failing due to precision issues?

  • Проголосовать: нравится
  • +1
  • Проголосовать: не нравится