結果
| 問題 |
No.513 宝探し2
|
| コンテスト | |
| ユーザー |
femto
|
| 提出日時 | 2017-05-05 23:08:37 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
RE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 569 bytes |
| コンパイル時間 | 1,461 ms |
| コンパイル使用メモリ | 166,040 KB |
| 実行使用メモリ | 25,604 KB |
| 平均クエリ数 | 80.17 |
| 最終ジャッジ日時 | 2024-07-16 13:09:00 |
| 合計ジャッジ時間 | 4,393 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | RE * 12 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int k;
int q(int x, int y) {
cout << x << " " << y << endl;
cout.flush();
int res;
cin >> res;
return res;
}
ll sim(int x) {
int a[2] = { 0, 0 };
a[k] = x;
return q(a[0], a[1]);
}
ll findMin(ll from, ll to) {
for(; to - from > 1;) {
ll mid = (from + to) / 2;
(sim(mid - 1) > sim(mid) ? from : to) = mid;
}
return from;
}
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int ans[2];
for(k = 0; k < 2; k++) {
ans[k] = findMin(0, 1000001);
}
assert(q(ans[0], ans[1]));
}
femto