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

30306번 - Better Dice 다국어

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

문제

The latest Table-Top Role Playing Game is out now: Better Dice. Unlike all other TTRPGs, this one is all about dice. In fact, it is all about the better die: decisions are made, friendships gained and lost, fights fought, battles won, all based on who has the better die.

This game uses special $n$-sided dice where each of the $n$ faces has the same probability of being rolled. Moreover, each die has its own special set of $n$ numbers on the faces.

While playing Better Dice you ended up in a very precarious situation where you must absolutely have a better die than your opponent, that is, you must roll higher than your opponent. Given both your die and your opponent's die, decide who is more likely to roll a higher number.

입력

The input consists of:

  • One line with an integer $n$ (1ドル\leq n\leq 1000$), the number of sides on each die.
  • Two lines, each with $n$ integers $d$ (1ドル \leq d \leq 10^9$), the values on one of the dice.

출력

Output "first" if the first die is more likely to roll a higher number than the second die. Output "second" if the second die is more likely to roll a higher number than the first die. Output "tie" if they are both equally likely to come up higher than the other.

제한

예제 입력 1

2
4 6
5 5

예제 출력 1

tie

예제 입력 2

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

예제 출력 2

second

예제 입력 3

3
2 2 2
1 1 8

예제 출력 3

first

힌트

출처

ICPC > Regionals > Europe > Northwestern European Regional Contest > Benelux Algorithm Programming Contest > BAPC 2023 Preliminaries B번

  • 문제를 만든 사람: Mees de Vries
(追記) (追記ここまで)

출처

대학교 대회

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

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