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

13216번 - Badminton 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 64 MB36228625679.012%

문제

Anisa (Player A) and Ben (Player B) are playing a singles badminton match. Here are the basic badminton rules:

  • To win a match, a player needs to win 2 out of 3 games.
  • The first player to reach 21 points wins the game. (A different rule applies when the players are tied 20-20. You may assume this case does not happen.)
  • Either player can score a point no matter who serves.
  • After a game is won, a new game begins and the score resets to 0-0.

입력

A sequence of A’s and B’s that records which player scored for each serve.

출력

The score and who wins the match (A or B).

제한

예제 입력 1

AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

예제 출력 1

21-0
21-0
A

예제 입력 2

BBBBBBBBBBBBBBBBBBBBBAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBB

예제 출력 2

0-21
21-0
0-21
B

예제 입력 3

ABBBBAABABBAABABAABBBAABBBAABBBAAAAAAAABBBAABAAABBBBBBAABBBBBAABBBBAAABBAAABBBBAAAABBAABBBABBAABBABBBABAABAABAAA

예제 출력 3

21-18
12-21
21-19
A

힌트

출처

Olympiad > Malaysian Computing Olympiad > MCO 2015 A번

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

출처

대학교 대회

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

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