結果

問題 No.513 宝探し2
ユーザー 37zigen37zigen
提出日時 2017-05-05 23:02:42
言語 Java21
(openjdk 21)
結果
AC  
実行時間 181 ms / 2,000 ms
コード長 941 bytes
コンパイル時間 3,620 ms
コンパイル使用メモリ 82,052 KB
実行使用メモリ 73,468 KB
平均クエリ数 49.25
最終ジャッジ日時 2023-09-24 01:06:26
合計ジャッジ時間 4,908 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 181 ms
72,852 KB
testcase_01 AC 174 ms
72,872 KB
testcase_02 AC 166 ms
72,524 KB
testcase_03 AC 169 ms
73,468 KB
testcase_04 AC 179 ms
72,448 KB
testcase_05 AC 172 ms
72,424 KB
testcase_06 AC 174 ms
73,060 KB
testcase_07 AC 169 ms
73,232 KB
testcase_08 AC 131 ms
71,824 KB
testcase_09 AC 127 ms
72,320 KB
testcase_10 AC 175 ms
72,424 KB
testcase_11 AC 128 ms
71,596 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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);
		System.out.println(100000 + " " + 0);
		int h = sc.nextInt();
		if (h == 0)
			return;
		System.out.println(0 + " " + 0);
		int v = sc.nextInt();
		if (v == 0)
			return;
		int X = (v - h + 100000) / 2;
		System.out.println(0 + " " + 100000);
		h = sc.nextInt();
		if (h == 0)
			return;
		System.out.println(0 + " " + 0);
		v = sc.nextInt();
		if (v == 0)
			return;
		int Y = (v - h + 100000) / 2;
		for (int i = -5; i <= 5; ++i) {
			for (int j = -5; j <= 5; ++j) {
				System.out.println((X + i) + " " + (Y + j));
				int tmp = sc.nextInt();
				if (tmp == 0)
					return;
			}
		}
	}

	static void tr(Object... objects) {
		System.out.println(Arrays.deepToString(objects));
	}

}
0