| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 1024 MB | 55 | 20 | 16 | 34.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.
| 번호 | 배점 | 제한 |
|---|---|---|
| 1 | 9 | $n\leq 50$ |
| 2 | 11 | $n\leq 1000$ |
| 3 | 80 | 1000ドル < n\leq 1500$ |
3 431 121 121
? 1 2 ? 1 3 ? 3 2 ! 431 431 121