結果
| 問題 |
No.513 宝探し2
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-05-05 22:46:33 |
| 言語 | Java (openjdk 23) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,178 bytes |
| コンパイル時間 | 2,609 ms |
| コンパイル使用メモリ | 81,008 KB |
| 実行使用メモリ | 72,564 KB |
| 平均クエリ数 | 98.00 |
| 最終ジャッジ日時 | 2024-07-16 13:01:22 |
| 合計ジャッジ時間 | 8,203 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 12 |
ソースコード
import java.util.Arrays;
import java.util.Scanner;
import java.util.concurrent.SynchronousQueue;
class Main {
int N, M;
int[] X, Y;
public static void main(String[] args) {
new Main().run();
}
void run() {
Scanner sc = new Scanner(System.in);
// [0,10^5]*[0,10^5]
// 三分探索
// 一回の操作で2/3
int lX = 0, rX = 1_000_00;
int lY = 0, rY = 1_000_00;
for (int i = 0; i < 24; ++i) {
int lx = (2 * lX + rX) / 3;
int rx = (lX + 2 * rX) / 3;
System.out.println(lx + " " + 0);
int vl = sc.nextInt();
System.out.println(rx + " " + 0);
int vr = sc.nextInt();
if (vl < vr) {
lX = lx;
} else {
rX = rx;
}
}
for (int i = 0; i < 24; ++i) {
int ly = (2 * lY + rY) / 3;
int ry = (lY + 2 * rY) / 3;
System.out.println(lX + " " + ly);
int vl = sc.nextInt();
System.out.println(lX + " " + ry);
int vr = sc.nextInt();
if (vl < vr) {
lY = ly;
} else {
rY = ry;
}
}
System.out.println(rX + " " + rY);
int vl = sc.nextInt();
System.out.println(rX + " " + lY);
int vr = sc.nextInt();
}
static void tr(Object... objects) {
System.out.println(Arrays.deepToString(objects));
}
}