Little Elephant and Boxes
Little Elephant from Zoo of Lviv has n boxes. He don't know what is in the boxes, but he thinks that i-th box (0-based numeration) contains Vi dollars. The probability that i-th box will contain money is Pi percents. Instead of money i-th box may contain a single diamond (with the probability 100-Pi percents). There are m things to buy, numbered from 0 to m-1, j-th thing costs exactly Cj dollars
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start