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

建议使用的浏览器:

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

2268:Euro Cup 2000

题目描述
As you maybe know, the qualification for the European Soccer Championship 2000 is a tournament where in each group each team plays against each other team twice. Germany is in group 3 together with Turkey, Finland, Moldova and Northern Ireland. 14 games have been played and 6 are still to come.
A quick look at the current standings might make you think that Northern Ireland is already out of the race. But that's wrong! Imagine Northern Ireland wins their three remaining games, Germany plays remis against Turkey and loses against Finland, and Moldova defeats Turkey. Then Northern Ireland is number one!

For those who are not familiar with the scoring model: In each game a team gains 3 points for a victory, 1 point for a remis or 0 points for a loss. After all games have been played, teams are ranked according to points. In case of a tie, the additional tie breakers are: goal difference (i.e. goals scored - goals against), goals scored, and random choice, in that order.

The question your program should answer is:
Regarding all possibilities of how the remaining games could end, what is the highest and lowest possible rank of each team in the group after the tournament is over?
输入解释
The input will consist of one or more test cases. Each test case adheres to the following format:
  • On the first line there will be one integer n (1 <= n <= 20), representing the number of teams in the group.
  • On the next n lines, the names of the teams will follow. Names are always shorter than 30 characters and do not contain whitespace.
  • On the next line, there will be an integer g, representing the number of completed games.
  • Finally, g lines will follow, each one describing one completed game in the form team1 team2 goals1 goals2.
  • You may further assume that at most 10 games will be remaining and each team has at least one remaining game to play. (This simplifies the problem a little.)

Input will be terminated by a value of zero (0) for n.
输出解释
For each test case, first print a line saying "Group #x" where x is the number of the test case (counting from 1).
Then, print one line per team in the order they appear in the input. On each line, print the team's name, a blank character, its best possible rank, a minus sign and its worst possible rank.
Print a blank line after each test case, even after the last one.
输入样例
2
A
B
1
A B 1 0
5
Ger
Tur
Fin
Nor
Mol
14
Fin Mol 3 2
Tur Nor 3 0
Tur Ger 1 0
Nor Fin 1 0
Mol Ger 1 3
Tur Fin 1 3
Nor Mol 2 2
Nor Ger 0 3
Tur Mol 2 0
Ger Fin 2 0
Mol Fin 0 0
Ger Mol 6 1
Fin Tur 2 4
Mol Nor 0 0
0
输出样例
Group #1
A 1-2
B 1-2

Group #2
Ger 1-3
Tur 1-3
Fin 1-4
Nor 1-5
Mol 4-5

该题目是Virtual Judge题目,来自 北京大学POJ

题目来源 Ulm Local 1999

源链接: POJ-2268

最后修改于 2020-10-29T06:28:04+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
1000 65536