Logo
(追記) (追記ここまで)

9947번 - Coin tossing 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB35329126984.326%

문제

When I was at school, many, many years ago, we used to play a simple game involving tossing a coin. The first player would call "heads" or "tails", the second would toss the coin. The first player gained a point for every correct call, the second player gained one for every incorrect call. When we got bored, we added up the scores!

입력

Input for this problem will consist of a number of games. Each game will begin with a line containing 2 names of no more than 20 letters each and separated by a space. The second line of each game will contain a single positive integer, n, specifying the number of recorded coin tosses (0 < n <= 1000). n coin tosses follow, each on a single lines containing 2 characters (either 'H' or 'T' – "heads" or "tails"), separated by a space. The first character denotes the call and the second denotes the result. Input will be terminated by a line containing just # #.

출력

Output will be one line for each game. The line will give the name of the first player (as recorded in the input), followed by the first player's score, followed by the name of the second player, followed by the second player's score. Entries on a line will be separated by a single space.

제한

예제 입력 1

Sally John
5
H H
H T
H H
T T
T H
Eloise Ahmed
4
H T
T T
H H
T H
# #

예제 출력 1

Sally 3 John 2
Eloise 2 Ahmed 2

힌트

출처

ICPC > Regionals > South Pacific > South Pacific Region > New Zealand Programming Contest > NZPC 2007 A번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /