結果

問題 No.513 宝探し2
ユーザー myantamyanta
提出日時 2017-05-05 22:41:04
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 29 ms / 2,000 ms
コード長 404 bytes
コンパイル時間 147 ms
コンパイル使用メモリ 25,280 KB
実行使用メモリ 24,372 KB
平均クエリ数 3.50
最終ジャッジ日時 2023-09-24 01:03:24
合計ジャッジ時間 1,355 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
23,508 KB
testcase_01 AC 23 ms
23,400 KB
testcase_02 AC 22 ms
23,652 KB
testcase_03 AC 24 ms
23,832 KB
testcase_04 AC 23 ms
24,312 KB
testcase_05 AC 24 ms
23,652 KB
testcase_06 AC 23 ms
24,324 KB
testcase_07 AC 22 ms
23,628 KB
testcase_08 AC 23 ms
23,616 KB
testcase_09 AC 23 ms
24,024 KB
testcase_10 AC 23 ms
24,036 KB
testcase_11 AC 24 ms
24,372 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<cstdio>


int ask(int x, int y)
{
	int d;

	printf("%d %d\n", x, y);
	fflush(stdout);
	scanf("%d", &d);
	return d;
}


int main(void)
{
	int i;
	int x, y;
	int d, d2, d3;

	for(i=0;i<25;i++)
	{
		d=ask(0, 0);
		if(d==0) break;
		d2=ask(100000, 0);
		if(d2==0) break;
		d3=ask(0, 100000);
		if(d3==0) break;
		x=(d+d3-100000)/2;
		y=(d+d2-100000)/2;
		if(ask(x, y)==0) return 0;
	}

	return 0;
}
0