编程介的小学生 2017-09-17 13:20 采纳率: 20.5%
浏览 821
已采纳

Yellow Card and Red Card

FIFA has changed its rule on yellow-card amnesties at the World Cup 2010 to reduce the chances of big name players missing out on the July 11 final.

Germany's Michael Ballack in 2002, Italy's Alessandro Costacurta in 1994 and Argentina's Claudio Caniggia in 1990 are the best-known players to have missed World Cup finals after picking up second yellow cards in semis.

So for this tournament, world soccer's governing body has shifted its usual amnesty for yellow cards from the end of the first round until after the quarter-finals instead.

That means players would only miss the final if they receive two yellow cards -- or of course a straight red -- in a semi-final game, rather than in the past when they may have carried one yellow card going into a semi.

"FIFA simply said we want to give the best players a chance to play in the final," spokesman Marius Schneider said.

"The discussion first came up when Ballack was ruled out."

England fans remember the old rule well because of Paul Gascoigne's tears during their semi-final in Italy in 1990.

Although they eventually lost to Germany, the always emotional Gascoigne wept on the pitch when he received a yellow card that would have ruled him out of the final.

Red card rules remain the same.

A red carries at least a one-match suspension and possibly more if the disciplinary committee considers the offence particularly serious. So, in theory, a player red-carded even before a semi-final could also miss the final.

In this question, you should know the following rules:

A player can get yellow card or red card only when he is on the pitch.
If a player gets 2 yellow cards in one match, he must get a red card immediately, in this situation, it can be regarded as the player only gets 1 red card directly.
Whenever a player gets a red card, he should leave the pitch immediately.
If somebody gets a red card, he must miss one match.
Besides a red card, if a player gets 2 yellow cards accumulatively (can be received in different matches), he will also miss one match.
All the yellow cards must be recorded, except a player gets 2 yellow cards in one match.
If the player has to miss a match because of the 2 accumulative yellow cards, the record of these 2 yellow cards will be erased.
If a player gets both kinds of cards in the same match, the number of suspension, which results from the accumulation of all cards he has received, will be cumulative.
All of the punishment of suspension will be executed immediately from the next match.
The team who got championship played a total of 7 matches (1~3 indicate the first round) in the World Cup 2010.
In this world cup, no offence is considered particularly serious.
The change of rules on yellow-card amnesties made by FIFA, namely shifting amnesty for yellow cards from the end of the first round until after the quarter-finals instead, is practical.
Now we only consider the players in the champion team. You should output which one misses which match. In addition, your program should ignore the redundant wrong information in the input (in the order of date and time of matches, previous data is more reliable).

Input

There are several test cases (<=100). You should process to the end of input. There will be several matches for each test case. The first line is "Match i", i (1 <= i <= 7, an integer) indicates the match number. Then, some lines follow, indicating which players get cards in this match in time order with the following form: "player_number card" (0 <= player_number <= 99, an integer, card = "yellow" or "red"). After each case, there is a line "END". Keep in mind that in each line, all different data are separated by one blank.

Output

For each case, you should print which one misses which match. As the sample shows, you should output several lines, each of which is "match_number player_number". Your should print them order by match number first, then order by player number. There is only one blank between match_number and player_number. You also need to output a single line "#" after each case.

For each case, you should print which one misses which match. As the sample shows, you should output several lines, each of which is "match_number player_number" (There is only one blank between match_number and player_number). Besides, please sequence the lines accroding to the match_number (from small to large) first; for lines with same match_number, sequence them according to the player_number (from small to large). You also need to output a single line "#" after each case.

Sample Input

Match 1
1 red
END
Sample Output

2 1
#

  • 写回答

1条回答 默认 最新

  • threenewbee 2017-10-02 00:50
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 如何用stata画出文献中常见的安慰剂检验图
  • ¥15 c语言链表结构体数据插入
  • ¥40 使用MATLAB解答线性代数问题
  • ¥15 COCOS的问题COCOS的问题
  • ¥15 FPGA-SRIO初始化失败
  • ¥15 MapReduce实现倒排索引失败
  • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
  • ¥15 找一位技术过硬的游戏pj程序员
  • ¥15 matlab生成电测深三层曲线模型代码
  • ¥50 随机森林与房贷信用风险模型