2323. Rock Paper or Scissors

单点时限: 2.0 sec

内存限制: 256 MB

Rock, Paper, Scissors is a two player game, where each player simultaneously chooses one of the three items after counting to three. The game typically lasts a pre-determined number of rounds.

The player who wins the most rounds wins the game. Given the number of rounds the players will compete, it is your job to determine which player wins after those rounds have been played.

The rules for what item wins are as follows:

1.Rock always beats Scissors (Rock crushes Scissors)

2.Scissors always beat Paper (Scissors cut Paper)

3.Paper always beats Rock (Paper covers Rock)

输入格式

The first value in the input file will be an integer t (0 < t < 1000) representing the number of test cases in the input file. Following this, on a case by case basis, will be an integer n (0 < n < 100) specifying the number of rounds of Rock, Paper, Scissors played. Next will be n lines, each with either a capital R, P, or S, followed by a space, followed by a capital R, P, or S, followed by a newline. The first letter is Player 1’s choice; the second letter is Player 2’s choice.

输出格式

For each test case, report the name of the player (Player 1 or Player 2) that wins the game, followed by a newline. If the game ends up in a tie, print TIE.

样例

Input
3
2
R P
S R
3
P P
R S
S R
1
P R
Output
Player 2
TIE
Player 1

17 人解决,18 人已尝试。

18 份提交通过,共有 25 份提交。

3.4 EMB 奖励。

创建: 12 年,3 月前.

修改: 3 年,3 月前.

最后提交: 1 天,3 小时前.

来源: The 2007 ACM Pacific Northwest Programming Contest

题目标签