結果

問題 No.514 宝探し3
ユーザー femtofemto
提出日時 2017-05-05 23:16:10
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 475 bytes
コンパイル時間 1,526 ms
コンパイル使用メモリ 164,296 KB
実行使用メモリ 24,408 KB
平均クエリ数 5.00
最終ジャッジ日時 2023-09-23 13:46:24
合計ジャッジ時間 4,256 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int q(int x, int y) {
	cout << x << " " << y << endl;
	cout.flush();
	int res;
	cin >> res;
	return res;
}

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);

	int ans[2];
	for(int k = 0; k < 2; k++) {
		int r1 = q(0, 0);
		int r2 = q(0, 1000000000);
		int d = abs(r1 - r2);
		if(r1 < r2) {
			ans[k] = (1e9 - d) / 2;
		}
		else {
			ans[k] = 1e9 - (1e9 - d) / 2;
		}
	}
	assert(q(ans[0], ans[1]));
}
0