結果

問題 No.514 宝探し3
ユーザー uwiuwi
提出日時 2017-05-06 02:17:53
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 1,039 bytes
コンパイル時間 3,372 ms
コンパイル使用メモリ 78,812 KB
実行使用メモリ 151,924 KB
平均クエリ数 2.92
最終ジャッジ日時 2023-09-23 13:55:09
合計ジャッジ時間 6,491 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 170 ms
56,512 KB
testcase_01 AC 169 ms
56,008 KB
testcase_02 AC 156 ms
55,964 KB
testcase_03 AC 155 ms
56,372 KB
testcase_04 AC 172 ms
56,880 KB
testcase_05 AC 172 ms
56,492 KB
testcase_06 AC 169 ms
56,212 KB
testcase_07 AC 151 ms
56,444 KB
testcase_08 RE -
testcase_09 AC 168 ms
56,568 KB
testcase_10 AC 167 ms
56,912 KB
testcase_11 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

package contest170505;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

public class BB {
	static Scanner in;
	static PrintWriter out;
	static String INPUT = "";
	
	static int d(int x, int y)
	{
		out.println(x + " " + y);
		out.flush();
		return ni();
	}
	
	static void solve()
	{
		int D = 1000000000;
		int d00 = d(0, 0);
//		if(d00 == 0)return;
		int d01 = d(0, D);
//		if(d01 == 0)return;
		// a+b=D1
		// a+c=D2
		// b+c=10^6
		int a = (int)(((long)d00+d01+D)/2-D);
		int b = (int)(((long)d00+d01+D)/2-d01);
		d(a, b);
	}
	
	public static void main(String[] args) throws Exception
	{
		in = INPUT.isEmpty() ? new Scanner(System.in) : new Scanner(INPUT);
		out = new PrintWriter(System.out);
		
		solve();
		out.flush();
	}
	
	static int ni() { return Integer.parseInt(in.next()); }
	static long nl() { return Long.parseLong(in.next()); }
	static double nd() { return Double.parseDouble(in.next()); }
	static void tr(Object... o) { if(INPUT.length() != 0)System.out.println(Arrays.deepToString(o)); }
}
0