#P1559. 运动员最佳匹配问题
运动员最佳匹配问题
Description
A badminton team has male athletes and female athletes. You are given two matrices and . is the male athlete 's competitive advantage when paired with female athlete in mixed doubles; is the female athlete 's competitive advantage when cooperating with male athlete .
However, due to various factors such as technical coordination and psychological state, is not necessarily equal to . The combined competitive advantage of the pair consisting of male athlete and female athlete is .
Now, design an algorithm to compute the optimal pairing between male and female athletes so that the sum of the combined competitive advantages across all pairs is maximized.
Input Format
The first line contains one positive integer . The next lines each contain numbers. The first lines are , and the last lines are .
Output Format
Output the maximum possible sum of the combined competitive advantages across all pairs.
3
10 2 3
2 3 4
3 4 5
2 2 2
3 5 3
4 5 1
52
Hint
Translated by ChatGPT 5
京公网安备 11011102002149号