22789_Lineup

2022-5-16 18:22| 发布者: Hocassian| 查看: 19| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-5-89506959867100-Problem List-采集的数据-后羿采集器.html

Pro.ID

22789

Title

Lineup

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=22789

AC

6

Submit

18

Ratio

33.33%

时间&空间限制

  • Time Limit: 1000/500 MS (Java/Others)     Memory Limit: 65536/65536 K (Java/Others)
  • 描述

    OnJune 13th team Germany has its first match in the FIFA world cup against team Australia. As the coach of team Germany, it is your duty to select the lineup for the game. Given this is your first game in the cup, naturally you want to make a good impression. Therefore you'd like to play with the strongest lineup possible.

    You have already decided on the tactical formation you wish to use, so now you need to select the players who should fill each of the 11 positions in the team. Your assistant has selected the 11 strongest players from your squad, but this still leaves the question where to put which player.

    Most players have a favoured position on the field where they are strongest, but some players are proficient in different positions. Your assistant has rated the playing strength of each of your 11 players in each of the 11 available positions in your formation, where a score of 100 means that this is an ideal position for the player and a score of 0 means that the player is not suitablefor that position at all. Find the lineup which maximises the sum of the playing strengths of your players for the positions you assigned them. All positions must be occupied, however, do not put players in positions they are     not proficient with (i.e. have a score of 0).

    输入

    The input consists of several test cases. The first line of input contains the number C of test cases. For each case you are given 11 lines, one for each player, where the i-th line contains 11 integer numbers sij between 0 and 100. sij describes the i-th player's strength on the j-th position. No player will be proficient in more than five different positions.

    输出

    Description

    OnJune 13th team Germany has its first match in the FIFA world cup against team Australia. As the coach of team Germany, it is your duty to select the lineup for the game. Given this is your first game in the cup, naturally you want to make a good impression. Therefore you'd like to play with the strongest lineup possible.

    You have already decided on the tactical formation you wish to use, so now you need to select the players who should fill each of the 11 positions in the team. Your assistant has selected the 11 strongest players from your squad, but this still leaves the question where to put which player.

    Most players have a favoured position on the field where they are strongest, but some players are proficient in different positions. Your assistant has rated the playing strength of each of your 11 players in each of the 11 available positions in your formation, where a score of 100 means that this is an ideal position for the player and a score of 0 means that the player is not suitablefor that position at all. Find the lineup which maximises the sum of the playing strengths of your players for the positions you assigned them. All positions must be occupied, however, do not put players in positions they are     not proficient with (i.e. have a score of 0).

    Input

    The input consists of several test cases. The first line of input contains the number C of test cases. For each case you are given 11 lines, one for each player, where the i-th line contains 11 integer numbers sij between 0 and 100. sij describes the i-th player's strength on the j-th position. No player will be proficient in more than five different positions.

    Output

    For each test case output the maximum of the sum of player strengths over all possible lineups. Each test case result should go on a separate line. There will always be at least one valid lineup.

    Sample Input

    1
    100 0 0 0 0 0 0 0 0 0 0
    0 80 70 70 60 0 0 0 0 0 0
    0 40 90 90 40 0 0 0 0 0 0
    0 40 85 85 33 0 0 0 0 0 0
    0 70 60 60 85 0 0 0 0 0 0
    0 0 0 0 0 95 70 60 60 0 0
    0 45 0 0 0 80 90 50 70 0 0
    0 0 0 0 0 40 90 90 40 70 0
    0 0 0 0 0 0 50 70 85 50 0
    0 0 0 0 0 0 66 60 0 80 80
    0 0 0 0 0 0 50 50 0 90 88

    Sample Output

    970

    Source

    样例输入

    1
    100 0 0 0 0 0 0 0 0 0 0
    0 80 70 70 60 0 0 0 0 0 0
    0 40 90 90 40 0 0 0 0 0 0
    0 40 85 85 33 0 0 0 0 0 0
    0 70 60 60 85 0 0 0 0 0 0
    0 0 0 0 0 95 70 60 60 0 0
    0 45 0 0 0 80 90 50 70 0 0
    0 0 0 0 0 40 90 90 40 70 0
    0 0 0 0 0 0 50 70 85 50 0
    0 0 0 0 0 0 66 60 0 80 80
    0 0 0 0 0 0 50 50 0 90 88

    样例输出

    970

    提示

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部