結果
| 問題 | 
                            No.514 宝探し3
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2017-05-05 22:57:20 | 
| 言語 | Java  (openjdk 23)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 150 ms / 2,000 ms | 
| コード長 | 1,083 bytes | 
| コンパイル時間 | 3,758 ms | 
| コンパイル使用メモリ | 77,488 KB | 
| 実行使用メモリ | 70,728 KB | 
| 平均クエリ数 | 2.75 | 
| 最終ジャッジ日時 | 2024-07-16 13:04:32 | 
| 合計ジャッジ時間 | 5,683 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 12 | 
ソースコード
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();
		if (a0 == 0) {
			return;
		}
		query(1_000_000_000, 0);
		long a1 = sc.nextLong();
		if (a1 == 0) {
			return;
		}
		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();
			if (tmp == 0) {
				return;
			}
		}
	}
	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);
		}
	}
}