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

30435번 - Die Hard 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 (추가 시간 없음) 1024 MB106807976.699%

문제

John and Hans are playing a game involving 3 dice. Even though they are all 6-sided, they are not guaranteed to be identical.

First John picks one of the dice and then Hans picks one of the remaining two. Then they both roll their chosen die. If they roll the same number, they both re-roll their die. Otherwise the winner is the one who rolled the highest number.

In case neither John or Hans can win with their chosen dice, they do not bother to re-roll the dice indefinitely and no winner is declared.

Can you help John pick a die that guarantees that he wins with a probability of at least $\frac{1}{2}$?

입력

The input consists of three lines. Line $i$ contains 6ドル$ positive integers $x_j$ (1ドル \leq x_j \leq 1000$), describing the sides of the $i$'th die.

출력

Output the smallest $i \in \{1, 2, 3\},ドル such that John can pick die $i$ and be guaranteed to win with probability at least $\frac{1}{2}$. If no such die exists, output "No dice".

제한

예제 입력 1

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

예제 출력 1

1

예제 입력 2

1 1 1 1 1 1
2 2 2 2 2 2
3 3 3 3 3 3

예제 출력 2

3

예제 입력 3

2 2 4 4 9 9
1 1 6 6 8 8
7 7 5 5 3 3

예제 출력 3

No dice

예제 입력 4

1 1 1 1 1 1
2 2 2 2 2 2
2 2 2 2 2 2

예제 출력 4

No dice

힌트

출처

ICPC > Regionals > Europe > Northwestern European Regional Contest > Nordic Collegiate Programming Contest > NCPC 2023 D번

  • 문제를 만든 사람: Asger Hautop Drewsen, Oskar Haarklou Veileborg
(追記) (追記ここまで)

출처

대학교 대회

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

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