#P2460. [SDOI2007] 科比的比赛
[SDOI2007] 科比的比赛
Description
There are participants in total, including Kobe. Each of the other participants has an ability value . Kobe will play matches. In each match, he faces one opponent who has not been defeated before. Once Kobe defeats someone, that opponent will no longer participate.
Kobe’s probability of defeating a specific opponent varies by match index. Specifically, you are given an matrix , where is the probability that Kobe defeats opponent if they meet in match .
Choose the opponent Kobe faces in each of the matches (without repetition) to maximize the probability that Kobe wins all matches. Subject to achieving this maximum probability (with an error not exceeding ), maximize the sum of the ability values of the opponents that Kobe defeats.
Input Format
- The first line contains two positive integers .
- The second line contains integers, the ability values of the other participants.
- Then follows an matrix, the probabilities .
Output Format
- On the first line, output the maximum probability that Kobe wins all matches. The error must not exceed .
- On the second line, output the maximum sum of ability values among all strategies that achieve the maximum probability.
3 4
91 92 93 94
0.5 0.5 0.5 0.5
0.5 0.5 0.5 0.5
0.5 0.5 0.5 0.5
0.125
279
Hint
Constraints
;
。
This problem is Special Judge.
Translated by ChatGPT 5
京公网安备 11011102002149号