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

33093번 - Golden Tickets 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 2048 MB66524679.310%

문제

There are $N$ teams participating in INC 2023. The team ranked in the $i$th position is team $S_i,ドル representing institution $T_i$. It is known that the top $M$ teams in INC 2023 are eligible to participate in The ICPC Asia Jakarta 2023.

Apart from the top $M$ teams, Golden Tickets are given to at most top $K$ teams for which their institutions are not in the top $M$ of INC 2023. However, only at most one Golden Ticket will be given to each institution, and only the team with the highest rank in INC 2023 from each institution qualifies for the Golden Ticket. These Golden Tickets will allow them to participate in The ICPC Asia Jakarta 2023.

Determine the number of teams that will receive the Golden Tickets. Then, output the name of the teams that receive those Golden Tickets, sorted by the rank of the teams.

입력

The first line consists of three integers $N$ $M$ $K$ (1ドル ≤ M, K ≤ N ≤ 100$).

Each of the next $N$ lines consists of two string $S_i$ $T_i$ (1ドル ≤ |S_i |, |T_i | ≤ 10$) separated by a whitespace. All strings consist of upper case letters. There are no teams with the same name. Formally, $S_i \ne S_j$ for 1ドル ≤ i < j ≤ N$.

출력

The first line consists of an integer, representing the number of teams that will receive the Golden Tickets. Denote this number as $X$.

Then, output $X$ lines, each consisting of the name of the teams that receive those Golden Tickets, sorted by their rank. If $X = 0,ドル then you do not need to print any names.

제한

예제 입력 1

3 1 2
ARUA UOGX
NOIHS UHOLO
IKUBUF UHOLO

예제 출력 1

1
NOIHS

Teams from institutions UOGX cannot receive Golden Tickets. The only institution that receives the Golden Ticket is UHOLO, represented by team NOIHS at rank 2ドル$.

예제 입력 2

3 2 1
ARUA UOGX
NOIHS UHOLO
IKUBUF UHOLO

예제 출력 2

0

Teams from institutions UOGX and UHOLO cannot receive Golden Tickets. There are no institutions that receive a Golden Tickets.

예제 입력 3

5 1 2
ARUA UOGX
NOIHS UHOLO
IKUBUF UHOLO
ANUZAN UVSH
LAMLA UNIJI

예제 출력 3

2
NOIHS
ANUZAN

The first institution that receives the Golden Ticket is UHOLO, represented by team NOIHS at rank 2ドル$. The second institution that receives a Golden Ticket is UVSH, represented by team ANUZAN at rank 4ドル$.

예제 입력 4

9 3 3
ARUA UOGX
ANUZAN UVSH
NOIHS UHOLO
IKUBUF UHOLO
LAMLA UNIJI
IKASAS UNIJI
ESUOMNORI UVSH
AIHSUR URIP
AYNEH UVSH

예제 출력 4

2
LAMLA
AIHSUR

Teams from institutions UOGX, UVSH, and UHOLO cannot receive Golden Tickets. The first institution that receives the Golden Ticket is UNIJI, represented by team LAMLA at rank 6ドル$. The second institution that receives a Golden Ticket is URIP, represented by team AIHSUR at rank 8ドル$. It is impossible to give 3ドル$ Golden Tickets.

노트

Disclaimer

All team names and institution names in the samples are fictional. Any similarities with actual participants in INC 2023 are purely coincidental.

출처

ICPC > Regionals > Asia Pacific > Indonesia > Indonesia National Contest > INC 2023 A번

ICPC > Regionals > Asia Pacific > Indonesia > Indonesia National Contest > INC 2024 연습 세션 PA번

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

출처

대학교 대회

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

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