There are fish in a lake. Each second, two fish meet uniformly at random, and one eats the other. You're given a matrix where is the probability that fish eats fish when they meet.
Find the probability that each fish is the last survivor. Output probabilities.
Constraints: . This hints at bitmask DP since states are manageable.
Simulating all meeting sequences grows factorially. Instead, track the set of surviving fish as state since transitions only depend on which fish remain.