当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

4924:Football Manager

题目描述
Football Manager is a series of football management simulation games developed by Sports Interactive and published by Sega. In this game, you will play a role of a football club manager and conduct your team to chase championship titles. As a football team manager, you need to take responsibilities for tactics developing, training arrangements, on-pitch commanding, player trading, etc. One of the most important things is to select your starting line-up.

According to the rules of football matches, there should be 11 players in your starting line-up, where one of them must be a goalkeeper. Besides the goalkeeper (GK), there’re three classes of positions: defender (DF), midfielder (MF), and striker (ST).

When a manager is selecting his starting line-up, he usually determines the formation first. The football formation is usually noted like “4-4-2”“4-5-1”“4-3- 3”, etc. For example, the “4-5-1” formation denotes that there are 4 defenders, 5 midfielders and 1 striker. Note that every player has his preferred positions, and they will always refuse to appear at positions he does not prefer, while some excellent players may be qualified for several positions. For example, C. Ronaldo can play as both a striker and a midfielder.

In the game, players have two important attributes for each of his preferred positions: CA (current ability) and PA (potential ability). The CA of the line-up is defined as the sum of the 11 players’ CA in the formation. Similar to CA, the PA of the line-up equals to the sum of 11 players’ PA. Then your task is to select the proper players to reach maximum CA of your line-up. When a tie occurs, the one of maximum PA is required.

Beyond these requirements and limits, the relationships between players also make sense to the CA of your line-up. Every player may like or dislike some of his teammates. When he and the one he likes are both on the pitch, the CA of the line-up will be increased by a specific value. On the contrary, when someone and his disliked player occurs on the pitch concurrently, the line-up’s CA will be decreased. Be careful that the like and dislike relationships between players are unidirectional. Not surprisingly, Plane.Gao likes Messi very much while Messi may not know Plane.Gao at all.
输入解释
The input contains multiple test cases. The first line of input gives the number of test cases T (1<=T<=20).

For each test case, the first line contains an integer N (1<=N<=20), the total number of players in your team.

Each of the following N lines describe a player in the following format:
<SquadNum> <PositionNum> <pos1> <CA1> <PA1> <pos2> <CA2> <PA2> . . . <posnum><CAnum><PAnum>
Here:
<SquadNum> denotes the player’s unique squad number (between 1 and 99, inclusive).
<PositionNum> denotes the number of positions he preferred.
<pos1> <pos2> . . . <posnum> are strings chosen in {GK, DF, MF, ST},denoting all his preferred positions.
<CAi> denotes his CA at <posi>.
<PAi> denotes his PA at <posi>.
(0<=|P Ai|,|C Ai|<=1000,note P A and CA can be negative here.)
After the description of the player list, the following line will give an integer M (0<=M<=N (N - 1)), which indicates the number of relationships between the teammates. Then each of the following M lines is shown in the following format:
<SquadNumA> <SquadNumB > Like/Dislike <value>
Here:
<SquadNumA> denotes Player A’s Squad Number.
<SquadNumB> denotes Player B’s Squad Number.
Like/Dislike denotes the property of the relationship.
<value> denotes that when both of them appear in your starting line-up, the CA of line-up will be increased/decreased by value(0<=value<=100).
No two relationships of the same pair of teammates will occur.
The last line of each test case shows the formation that you have determined. We guarantee that the formation is legal.
You may take the sample for more details.
输出解释
For each test case, you should output two integers in a line, the best CA and PA of your line-up. If you can even not round up your line-up, please output “Poor Manager!” (without quotes)
输入样例
2
15
1 1 GK 150 160
2 1 DF 150 160
3 1 DF 150 160
4 1 DF 150 160
5 1 DF 150 160
6 1 MF 150 160
7 1 MF 150 160
8 1 MF 150 160
9 1 ST 150 160
10 1 MF 150 160
11 1 ST 150 160
12 1 GK 130 150
13 1 DF 130 150
14 1 MF 130 150
15 1 ST 130 150
2
15 9 Like 10
2 13 Dislike 20
4-4-2

11
1 1 GK 150 160
2 1 DF 150 160
3 1 DF 150 160
4 1 DF 150 160
5 1 DF 150 160
6 1 MF 150 160
7 1 MF 150 160
8 1 MF 150 160
9 1 ST 150 160
10 1 MF 150 160
11 1 ST 150 160
0
4-3-3
输出样例
1650 1760
Poor Manager!
来自杭电HDUOJ的附加信息
Author BUPT
Recommend

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-4924

最后修改于 2020-10-25T23:18:07+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
6000/3000MS(Java/Others) 262144/262144K(Java/Others)