結果
| 問題 |
No.514 宝探し3
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-04-15 21:55:54 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 35 ms / 2,000 ms |
| コード長 | 438 bytes |
| コンパイル時間 | 995 ms |
| コンパイル使用メモリ | 66,048 KB |
| 最終ジャッジ日時 | 2025-01-09 19:20:07 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 12 |
ソースコード
#include <iostream>
constexpr int INF = 1000000000;
int query(int x, int y) {
std::cout << x << " " << y << std::endl;
int d;
std::cin >> d;
if (d == 0) std::exit(0);
return d;
}
void solve() {
int d1 = query(0, 0);
int d2 = query(INF, 0);
query((d1 - d2 + INF) / 2, (d1 + d2 - INF) / 2);
}
int main() {
std::cin.tie(nullptr);
std::ios::sync_with_stdio(false);
solve();
return 0;
}