Fish
HardRating 1900CodeforcesAdvanced DP (Bitmask, Digit, Interval)
Approach hintTry it first, then revealHide
Let dp[mask] be the probability that exactly the fish in mask are alive at some moment. From a mask with c fish, each of the c(c-1)/2 pairs meets with equal chance and the meeting removes one fish.