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

24817번 - Competitive Arcade Basketball 다국어

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

문제

You're attending a arcade basketball competition, where the objective is to score as many points as possible until the time runs out. The announcer has informed the crowd that their scoreboard is broken, so they don't have a way to keep track of all the scores. As a seasoned programmer, you feel you can whip up a program that can keep track of the names of the players and the amount of points they've scored, announcing the winner(s) at the end of the contest.

입력

The first line contains three integers: the number of participants $n$ (1ドル \le n \le 100,000円$); the minimum number $p$ of points required to win the contest (10ドル \le p \le 10,001円$); and $m,ドル the number of lines with player names and points (1ドル \le m \le 200,000円$). The next $n$ lines contain the names of the participants, each mentioned exactly once. Each name consist of no more than 20ドル$ alphanumerical characters. The remaining $m$ lines each contain the name of a participant, followed by how many points they scored (1ドル,ドル 2ドル,ドル or 3ドル$).

출력

Output the names of those participants who reached the minimum required score, one per line! Output "<Winner> wins!" for each winner. Output the winners in the order in which they've reached the required score. If no one reaches the minimum required score, output "No winner!" (including the exclamation mark!).

제한

예제 입력 1

3 10 13
John
Kelly
George
Kelly 1
George 2
Kelly 1
John 2
George 1
John 3
Kelly 3
Kelly 1
George 3
George 1
John 3
George 3
Kelly 1

예제 출력 1

George wins!

예제 입력 2

4 10 13
Bob
Nina
Jess
Tim
Nina 2
Bob 2
Nina 1
Jess 3
Bob 2
Jess 2
Nina 1
Jess 2
Nina 3
Bob 1
Nina 3
Jess 3
Bob 2

예제 출력 2

Nina wins!
Jess wins!

예제 입력 3

4 15 13
Bob
Nina
Jess
Tim
Nina 2
Bob 2
Nina 1
Jess 3
Bob 2
Jess 2
Nina 1
Jess 2
Nina 3
Bob 1
Nina 3
Jess 3
Bob 2

예제 출력 3

No winner!

힌트

출처

School > Virginia Tech High School Programming Contest > 2018 Virginia Tech High School Programming Contest M번

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

출처

대학교 대회

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

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