포럼
문제 ICPC00295

D. Die Hard

설명

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
예제 2
입력
1 1 1 1 1 1
2 2 2 2 2 2
3 3 3 3 3 3
출력
3
예제 3
입력
2 2 4 4 9 9
1 1 6 6 8 8
7 7 5 5 3 3
출력
No dice
예제 4
입력
1 1 1 1 1 1
2 2 2 2 2 2
2 2 2 2 2 2
출력
No dice
문제 정보

생성자가 기록되지 않았습니다.

출처 ICPC NCPC 2023

평가 및 의견

D. Die Hard

개요
출제자 난이도 Unrated 레이팅 미적용 의견 0 / 1 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.

풀이 제출

D. Die Hard

게스트로 둘러보고 있습니다. 로그인하면 풀이를 제출하고 진행 상황을 확인할 수 있습니다. 로그인하고 제출하기
공개
C++20 Tab 들여쓰기 · Ctrl+/ 주석 토글 · Enter 자동 들여쓰기
1 1 1 0 공백: 4 · UTF-8