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

31975번 - Staring Contest 서브태스크점수다국어인터랙티브

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

문제

A staring contest is a classical battle of imperturbability in which two people stare into each other's eyes while maintaining a facial expression of assured serenity. The goal is to maintain eye contact for longer than your opponent. The contest ends when one participant breaks composure, typically by looking away, smiling, speaking, or giggling.

As a coach of the national staring contest you need to determine the imperturbability of each of your team's $n$ members for the upcoming world finals. The $i$th athlete can maintain eye contact for exactly $a_i$ seconds, but these values are unknown to you in the beginning. For instance, you could have a team of $n=3$ members:

$i$ Name $a_i$
1 Anna 431
2 Esther 623
3 Tony 121

When athletes $i$ and $j$ compete, the confrontation lasts exactly $\min(a_i, a_j)$ seconds, at which moment the weaker contestant breaks composure and both contestants start smiling and giggling within a fraction of a second. For instance, if Anna competes against Esther, the contest lasts for 431ドル$ seconds. Importantly, to an outside observer the actual winner of the confrontation (in this case, Esther) is impossible to determine, only the duration of the contest is measurable.

Your goal is to estimate the values $a_1,\ldots, a_n$ using as few staring contests as possible. Clearly, the strength of the strongest athlete can never be determined, so you are allowed to underestimate one of the $a_i$.

인터랙션

This is an interactive problem. The interaction begins with you reading a single line containing the integer $n$. You may then ask queries of the form "? $i$ $j$" such that 1ドル\leq i\leq n$ and 1ドル\leq j\leq n$ and $i\neq j$. The response to a query is a single integer: the value $\min(a_i, a_j)$. The interaction ends with you printing a single line consisting of ! followed by $n$ estimates in the form of integers $b_1,ドル $\ldots,ドル $b_n,ドル separated by spaces. This must be your final line of output.

Your submission is correct if $b_i=a_i$ for every contestant $i$ except one, which you may underestimate. To be precise, we require $b_i\leq a_i$ for all 1ドル\leq i\leq n$ and allow $b_k \neq a_k$ for at most one $k$.

The interactor is non-adaptive, meaning that the $a_1,\ldots, a_n$ are determined before the interaction begins.

입력

출력

제한

The number $n$ of athletes satisfies 2ドル\leq n\leq 1500$. The imperturbability $a_i$ of each athlete satisfies 1ドル\leq a_i\leq 86,400円,ドル they are all different. You can use at most 3000ドル$ queries; your final line of output, i.e., the line starting with !, is not counted as a query.

서브태스크

For subtask 3ドル,ドル your score is the minimum score among all test cases in the subtask. The score for each test case depends on the number of queries you use; fewer queries are better: Suppose you use $q$ queries. If $q \le n+25,ドル then you get the full 80ドル$ points. If $q > 3000,ドル then you get no points. Otherwise, you get 118ドル.2 - 12 \cdot \ln(q - n)$ points, rounded to the nearest integer. For instance, for $n = 1500$ and $q = 3000,ドル you get 30ドル$ points.

번호배점제한
19

$n\leq 50$

211

$n\leq 1000$

380

1000ドル < n\leq 1500$

예제 입력 1

3
431
121
121

예제 출력 1

? 1 2
? 1 3
? 3 2
! 431 431 121

힌트

출처

Olympiad > Baltic Olympiad in Informatics > BOI 2023 B번

채점 및 기타 정보

  • 예제는 채점하지 않는다.
  • 이 문제의 채점 우선 순위는 2이다.
(追記) (追記ここまで)

출처

대학교 대회

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

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