Agent Mission Assignment
Time limit1sMemory limit128 MB
Given an N x N matrix of success percentages, assign one mission per agent to maximize the product of chosen probabilities, essentially an assignment problem with a product (log-sum) objective.
- Level
Medium6 of 10
- Topics
- Dynamic programming, Bit manipulation, Combinatorics
- Solved
- No attempts yet
Problem
Secret agent 007 receives several missions every month and assigns them one by one to cousin agents who look like him. The number of agents and the number of missions are both N.
For each agent i and mission j, the probability that agent i successfully completes mission j is given as a percentage. Each agent must be assigned exactly one mission, and each mission must be assigned to exactly one agent.
The probability that all missions succeed is the product of the success probabilities of the assigned missions. Find the maximum possible probability that all missions succeed.
Input
The first line contains N, the number of missions and agents. (1 <= N <= 20)
Each of the next N lines contains N integers between 0 and 100, inclusive. The jth integer on the ith line is the probability, in percent, that agent i successfully completes mission j.
Output
Print the maximum probability, as a percentage, that all missions can be completed successfully. An absolute or relative error up to 0.000001 is allowed.