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

14038번 - Tournament Selection 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 512 MB41942817266767.966%

문제

Each player in a tournament plays six games. There are no ties. The tournament director places the players in groups based on the results of games as follows:

  • if a player wins 5 or 6 games, they are placed in Group 1;
  • if a player wins 3 or 4 games, they are placed in Group 2;
  • if a player wins 1 or 2 games, they are placed in Group 3;
  • if a player does not win any games, they are eliminated from the tournament.

Write a program to determine which group a player is placed in

입력

The input consists of six lines, each with one of two possible letters: W (to indicate a win) or L (to indicate a loss).

출력

The output will be either 1, 2, 3 (to indicate which Group the player should be placed in) or -1 (to indicate the player has been eliminated).

제한

예제 입력 1

W
L
W
W
L
W

예제 출력 1

2

예제 입력 2

L
L
L
L
L
L

예제 출력 2

-1

힌트

출처

Olympiad > Canadian Computing Competition & Olympiad > 2016 > CCC 2016 Junior Division 1번

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

출처

대학교 대회

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

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