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

Автор jaigurudev, история, 6 лет назад, По-английски

I have an array of N integers (a[N]). I start removing numbers from the array one by one. If at any point I remove an element a[i] and the sum of the remaining numbers is S, then the happiness increases by an amount of S/a[i]. What is the expected value of the total happiness ?

Initial happiness can be considered as 0.

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

»
6 лет назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится

This is a question from CodeNation Hiring Contest happened on 26th January 2019! You can look at the following blog:- https://mirror.codeforces.com/blog/entry/64719. It has a solution for it in the comments.