結果

問題 No.513 宝探し2
ユーザー 37zigen37zigen
提出日時 2017-05-05 23:05:25
言語 Java21
(openjdk 21)
結果
AC  
実行時間 155 ms / 2,000 ms
コード長 1,016 bytes
コンパイル時間 1,865 ms
コンパイル使用メモリ 77,792 KB
実行使用メモリ 73,132 KB
平均クエリ数 4.25
最終ジャッジ日時 2023-09-24 01:06:51
合計ジャッジ時間 4,562 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 151 ms
72,524 KB
testcase_01 AC 150 ms
72,904 KB
testcase_02 AC 154 ms
72,636 KB
testcase_03 AC 147 ms
72,356 KB
testcase_04 AC 150 ms
73,132 KB
testcase_05 AC 148 ms
72,916 KB
testcase_06 AC 146 ms
72,788 KB
testcase_07 AC 153 ms
72,500 KB
testcase_08 AC 126 ms
71,764 KB
testcase_09 AC 125 ms
72,004 KB
testcase_10 AC 155 ms
71,312 KB
testcase_11 AC 125 ms
71,800 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;
		System.out.println(X + " " + Y);
		int a=sc.nextInt();
		if(a==0)return;
		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