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

33405번 - Dota 322 for Droids 다국어투 스텝

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

문제

DotA is a sick mental game. It brings out the best and worst in you. It comes down to half a second. You can't just predict what's going to happen. You try to look at everything as pieces and pawns. You try to look at it as simply "The Game". Who ended up winning the mental warfare always win the series. That's how you're going to win tournaments. If you break the other mind it gets really easy... Some minds are really hard to beat though.

Droid N4-2A was lost for days because he started playing DotA professionally. But it's not the game you might recognize: droids play a different version of it.

In DotA for droids, there are 245ドル$ heroes divided into 5ドル$ attributes: strength, agility, intellect, universal, and stamina. But what's more interesting is the mode they are playing in: sixdraft. In this mode, as the name suggests, you are given 6ドル$ random heroes to pick among the 245ドル$. Then, you ban (exclude) 5ドル$ of the given heroes in a particular order. The remaining 6ドル$-th hero is the hero you will play with.

Droid N4-2A is participating in the tournament. Of course, other droids will be following and even placing bets. During the sixdraft, the audience will see what 5ドル$ heroes Droid N4-2A has banned and in what order. Based on that, they can guess which hero was picked (the 6ドル$-th hero) and bet some money on that.

Droid N4-2A wants to earn some money from it as well. He wants to collaborate with his friend Droid C-228PO, who will be betting. For 6ドル$ random heroes he gets, he wants to find a way to choose particular 5ドル$ heroes and ban them in such an order that his friend will be able to guess the 6ドル$-th remaining hero.

They want to think of a universal protocol that will allow them to earn money in every game. Help them!

This problem is in run-twice format. This means your program will be executed twice for the same test with different inputs.

During the first run, $n$ is 6ドル$. It means your program must act as Droid N4-2A. You will be given 6ドル$ heroes, and you need to print 5ドル$ of them in some order.

During the second run, $n$ is 5ドル$. It means your program must act as Droid C-228PO. You will be provided with 5ドル$ heroes: your output from the previous run. Note that the order of heroes will be preserved. You need to print the 6ドル$-th hero.

입력

The first line contains $n,ドル the number of heroes. The value of $n$ is either 5ドル$ or 6ドル$.

The second line contains $n$ distinct integers $a_i$ (1ドル \le a_i \le 245$).

If $n$ is 5ドル,ドル it is guaranteed that $a_i$ are the heroes you printed during the previous run, and their order is preserved.

출력

When $n$ is 6ドル,ドル print 5ドル$ integers: the heroes you want to ban.

When $n$ is 5ドル,ドル print a single integer: the remaining 6ドル$-th hero.

제한

인터랙션 프로토콜

This problem is tested with an interactor. For that reason please end the line and flush the output after printing. To flush the output, you can use fflush(stdout) in C/C++, System.out.flush() in Java, or sys.stdout.flush() in Python.

예제 입력 1

6
1 2 3 4 5 6

예제 출력 1

1 3 5 6 2

예제 입력 2

5
1 3 5 6 2

예제 출력 2

4

예제 입력 3

6
6 4
1 3
4 5
2 3
4 3

예제 출력 3

8

힌트

The provided examples are the two invocations on the first test.

출처

Camp > Petrozavodsk Programming Camp > Winter 2024 > Day 7: Kazakhstan Contest C번

채점 및 기타 정보

  • 예제는 채점하지 않는다.
(追記) (追記ここまで)

출처

대학교 대회

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

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