結果
問題 | No.514 宝探し3 |
ユーザー |
|
提出日時 | 2017-05-06 00:19:32 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 784 bytes |
コンパイル時間 | 696 ms |
コンパイル使用メモリ | 69,200 KB |
実行使用メモリ | 39,888 KB |
最終ジャッジ日時 | 2024-07-16 13:31:08 |
合計ジャッジ時間 | 7,025 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | TLE * 1 -- * 11 |
ソースコード
#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 n;cin >> n;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;}