結果

問題 No.514 宝探し3
ユーザー GrenacheGrenache
提出日時 2017-05-05 22:52:12
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 983 bytes
コンパイル時間 4,133 ms
コンパイル使用メモリ 74,464 KB
実行使用メモリ 72,456 KB
平均クエリ数 3.75
最終ジャッジ日時 2023-09-23 13:27:25
合計ジャッジ時間 7,053 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;


public class Main_yukicoder514 {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		query(0, 0);
		long a0 = sc.nextLong();
		query(1_000_000_000, 0);
		long a1 = sc.nextLong();

		int[] dx = {0, 1, 1, 0, -1, -1, -1, 0, 1};
		int[] dy = {0, 0, 1, 1, 1, 0, -1, -1, -1};

		long tmpx = (a0 - a1 + 1_000_000_000) / 2;
		long tmpy = (a0 + a1 - 1_000_000_000) / 2;

		for (int i = 0, size = dx.length; i < size; i++) {
			query(tmpx + dx[i], tmpy + dy[i]);
			long tmp = sc.nextLong();
		}
	}

	private static void query(long x, long y) {
		pr.printf("%d %d\n", x, y);
		pr.flush();
		return;
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(System.in);
		pr = new Printer(System.out);

		solve();

		pr.close();
		sc.close();
	}

	private static class Printer extends PrintWriter {
		Printer(PrintStream out) {
			super(out);
		}
	}
}
0