問題一覧 > 通常問題

No.2962 Sum Bomb Bomber

レベル : / AI推定難易度 : 1000 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / リアクティブ問題 (詳しくはこちら)
タグ : (AC するまで非表示) / 解いたユーザー数 52
作問者 : twitteryou / テスター : 👑 qand
お気に入りにしたユーザー ProblemId : 11524 / 自分の提出
問題文最終更新日: 2024-11-16 16:11:30
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.

  • Choose a lattice point $A$. You are given $\sum_{i=1}^{N}\text{dist}(A,D_i)$.

  • 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

  • $1 \leq N \leq 100$
  • $N$ is an integer.
  • $-10^8 \leq x_i,y_i \leq 10^8(1\leq i \leq N)$
  • $D_i(1\leq i \leq N)$ are lattice points.
  • The coordinates are fixed for each test case. That is, the coordinates do not change depending on the queries.
  • 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.
  • $-10^9 \leq x,y \leq 10^9$
  • $A$ is a lattice point.

  • 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.
  • $-10^9 \leq x,y \leq 10^9$
  • The answer point is a lattice point.
  • Notes

  • After each output, print a trailing newline and flush the output. Otherwise, the judge result may be TLE or WA.
  • The judge's behavior for invalid output or actions is undefined. Be careful not to output extra spaces or newlines.
  • After outputting the answer coordinates, terminate your program immediately. Otherwise, the judge result is undefined.
  • Outputting the answer does not count toward the number of queries.
  • Sample

    The following is one example.
    Program outputJudge outputExplanation
    1First, $N$ is passed. At this point, the judge is secretly holding $(x_1,y_1)=(1,0)$.
    1 2 3The query $(x_A,y_A)=(2,3)$ was sent to the judge.
    4Since $\text{dist}(A,D_1)=4$, $4$ is given.
    1 1 0The query $(x_A,y_A)=(1,0)$ was sent to the judge.
    0Since $\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もしくは右上の雲マークをクリックしてアカウントを作成してください。