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

24765번 - Mia 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB20213712069.364%

문제

Mia is a dice game for two players. Each roll consist of two dice. Mia involves bluffing about what a player has rolled, but in this problem we focus only on its scoring rules. Unlike most other dice games, the score of a roll is not simply the sum of the dice.

Instead, a roll is scored as follows:

  • Mia (12 or 21) is always highest.
  • Next come doubles (11, 22, and so on). Ties are broken by value, with 66 being highest.
  • All remaining rolls are sorted such that the highest number comes first, which results in a two-digit number. The value of the roll is the value of that number, e.g. 3 and 4 becomes 43.

입력

The input will contain multiple test cases. Each test case contains on a single line four integer numbers s0 s1 r0 r1 where s0 s1 represent the dice rolled by player 1 and r0 r1 represents the dice rolled by player 2. The input will be terminated by a line containing 4 zeros.

출력

For each test case, output which player won, or whether there was a tie, using exactly the format shown below.

제한

예제 입력 1

1 2 1 3
3 3 2 1
6 6 4 4
6 5 1 1
4 2 2 4
0 0 0 0

예제 출력 1

Player 1 wins.
Player 2 wins.
Player 1 wins.
Player 2 wins.
Tie.

힌트

출처

School > Virginia Tech High School Programming Contest > 2014 Virginia Tech High School Programming Contest A번

  • 문제를 만든 사람: Godmar Back
(追記) (追記ここまで)

출처

대학교 대회

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

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