結果
問題 | No.514 宝探し3 |
ユーザー |
|
提出日時 | 2017-05-06 00:19:55 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 763 bytes |
コンパイル時間 | 555 ms |
コンパイル使用メモリ | 69,164 KB |
実行使用メモリ | 25,604 KB |
平均クエリ数 | 5.92 |
最終ジャッジ日時 | 2024-07-16 13:31:23 |
合計ジャッジ時間 | 3,597 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 2 WA * 7 RE * 3 |
ソースコード
#include <iostream>#include <cstdio>#include <vector>#include <algorithm>#include <utility>#include <string>using namespace std;const int max_point = 1000000000;int query(int x, int y) {cout << x << " " << y << endl;int ret;cin >> ret;return ret;}int main() {int a = query(0, 0);if (a == 0) {return 0;}int b = query(max_point, max_point);if (b == 0) {return 0;}int add = a + b;int sub = a - b;int val, x, y;for (int i = 0; i < 2; i++) {if (i == 0) {x = add;y = sub;} else {x = sub;y = add;}x /= add;y /= sub;if (x < 0 || y < 0) {continue;}for (int j = 0; j < 4; j++) {val = query(x + j / 2, y + j % 2);if (val == 0) {return 0;}}}return 0;}