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

33536번 - A Match of Table Tennis 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 2048 MB2919866.667%

문제

The rules of a match of table tennis are quite easy. When a match is played best of five games, it means that the player who wins three games wins. Since there is no point of playing after a winner is decided only the following results are possible: 3-0, 3-1, 3-2, 0-3, 1-3 and 2-3. For each game, the first player to reach 11 points wins that game. However, a game must be won by at least a two point margin. Therefore scores such as 9-12 and 17-14 are not possible, but 9-11, 12-10 and 4-8 are. Each player serves two points in a row and then switch server. However, if a score of 10-10 is reached in any game, then each server serves only one point before the server is switched. In the first game the guest player starts serving, the next game the host starts serving, ect. Both players can score a point, not just the server.

While playing a match of table tennis players are often confused and don't know who the server is. You should help the table tennis players with a program, which can decide who the server is based on the scores. Since people can make mistakes while giving input to the program, you should also check for consistency. Note that you can only start a new game, when the previous game has a winner.

입력

On the first line a single integer n, 1ドル \leq n \leq 5,ドル the number of games played. On the second line $n$ scores in the form $a-b,ドル with 0ドル \leq a, b \leq 99$.

출력

Output "HOST" when the host player is serving, "GUEST" when the guest player is serving or "INCONSISTENT" when the input is not correct.

제한

예제 입력 1

1
4-5

예제 출력 1

GUEST

예제 입력 2

4
1-11 2-11 3-11 4-11

예제 출력 2

INCONSISTENT

예제 입력 3

2
4-8 3-10

예제 출력 3

INCONSISTENT

예제 입력 4

4
3-11 4-11 11-9 12-10

예제 출력 4

HOST

힌트

출처

University > Delft University of Technology > Freshmen Programming Contest 2016 A번

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

출처

대학교 대회

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

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