No.2962 Sum Bomb Bomber
レベル :
/ AI推定難易度 : 1000
/ 実行時間制限 : 1ケース 2.000秒 / メモリ制限
: 512 MB / リアクティブ問題 (詳しくはこちら)
タグ : / 解いたユーザー数 52
作問者 :
twitteryou
/ テスター :
👑
qand
タグ : / 解いたユーザー数 52
作問者 :
問題文最終更新日: 2024-11-16 16:11:30
English (AI translation)
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence.
Back to the original
yukicoder contest 453
(順位表)
の他の問題:
Story
Once again, bombs have been hidden in the watermelon field, but this time let's deal with them by auto-searching with a different ability.The probe has also become a direct one.
Please cooperate with us to protect as many watermelons as possible and to make things safe.
I'll leave a bit of trauma around here. Cos Bomb Crasher (I somehow got blamed because of this one.)
Problem Statement
Let $\text{dist}(A,B)$ denote the Manhattan distance between points $A$ and $B$.
There are $N$ lattice points $D_i(1\leq i \leq N)$, with coordinates $(x_i,y_i)$. You are given $N$, but you are not given the individual coordinates.
You may ask the following query up to $300$ times.
Using this query, find a lattice point $A$ that minimizes $\sum_{i=1}^{N}\text{dist}(A,D_i)$ among all lattice points. If there are multiple correct answers, finding any $1$ of them is accepted.
Constraints
Input and Output
First, $N$ is given.
$N$
To send a query with $A$ at coordinates $(x,y)$, output in the following format.
$1$ $x$ $y$
The following constraints must be satisfied.
The answer to the query, $d$, is given in the following format.
$d$
To output the answer with coordinates $(x,y)$, output in the following format.
$2$ $x$ $y$
The following constraints must be satisfied.
Notes
Sample
The following is one example.| Program output | Judge output | Explanation |
|---|---|---|
1 | First, $N$ is passed. At this point, the judge is secretly holding $(x_1,y_1)=(1,0)$. | |
1 2 3 | The query $(x_A,y_A)=(2,3)$ was sent to the judge. | |
4 | Since $\text{dist}(A,D_1)=4$, $4$ is given. | |
1 1 0 | The query $(x_A,y_A)=(1,0)$ was sent to the judge. | |
0 | Since $\text{dist}(A,D_1)=0$, $0$ is given. | |
2 1 0 | $(1,0)$ was output as the answer. This is correct because the value cannot be made any smaller. |
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。