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

31490번 - Throwing dice 다국어

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

문제

Alice and Bob are discussing penalty shoot-outs and their randomness: “We might as well be throwing dice to determine the winner!”, Alice said. And so they started simulating penalty shoot-outs by each throwing dice, summing the points indicated on their dice, and comparing these sums. The player with the largest sum wins; in case both sums are equal, there is a tie.

But even in such situations, some player might have an edge over their opponent, depending on which dice they throw. Thus, just by looking at the dice they are about to throw, Alice and Bob want to determine who has the better edge.

Alice has $M$ fair dice, with $A_1, A_2, \dots , A_M$ sides. For all integers $k$ and $\ell$ such that 1ドル \le k \le M$ and 1ドル \le \ell \le A_k,ドル the $k$th die of Alice has a probability 1ドル/A_k$ of showing its face numbered $\ell$. Then, Alice’s score is the sum of the numbers displayed by her $M$ dice. Similarly, Bob has $N$ fair dice, with $B_1, B_2, \dots , B_N$ sides.

Given these dice, Alice has a probability $\mathbb{P}_A$ of having a strictly larger score than Bob, and Bob has a probability $\mathbb{P}_B$ of having a strictly larger score than Alice. Which probability is the largest one?

입력

The input consists of three lines, each one containing space-separated integers. The first line contains the numbers $M$ and $N$. The second line contains the numbers $A_1, A_2, \dots , A_M$. The third line contains the numbers $B_1, B_2, \dots , B_N$.

출력

The output should contain a single line, consisting of a single uppercase word: ALICE if $\mathbb{P}_A > \mathbb{P}_B,ドル TIED if $\mathbb{P}_A = \mathbb{P}_B,ドル and BOB if $\mathbb{P}_A < \mathbb{P}_B$.

제한

  • 1ドル \le M \le 100,円 000$
  • 1ドル \le N \le 100,円 000$
  • 4ドル \le A_k \le 1,円 000,円 000,円 000$ for all $k \le M$
  • 4ドル \le B_k \le 1,円 000,円 000,円 000$ for all $k \le N$

예제 입력 1

8 1
4 4 4 4 4 4 4 4
6

예제 출력 1

ALICE

Since Alice has 8ドル$ dice, her score is always 8ドル$ or more; Bob’s score is always 6ドル$ or less. Hence, Alice has a probability $\mathbb{P}_A = 100\%$ of beating Bob, and he has a probability $\mathbb{P}_B = 0\%$ of beating her. Consequently, $\mathbb{P}_A > \mathbb{P}_B$.

예제 입력 2

2 2
6 4
4 6

예제 출력 2

TIED

Alice has a probability $\mathbb{P}_A = 125/288$ of beating Bob; he also has a probability $\mathbb{P}_B = 125/288$ of beating her.

힌트

출처

ICPC > Regionals > Europe > Southwestern European Regional Contest > SWERC 2023-2024 I번

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

출처

대학교 대회

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

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