結果
| 問題 |
No.3212 SUPER Guess the Number
|
| コンテスト | |
| ユーザー |
a01sa01to
|
| 提出日時 | 2025-09-26 00:58:25 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 26 ms / 2,000 ms |
| コード長 | 477 bytes |
| コンパイル時間 | 2,755 ms |
| コンパイル使用メモリ | 275,628 KB |
| 実行使用メモリ | 25,972 KB |
| 平均クエリ数 | 21.83 |
| 最終ジャッジ日時 | 2025-09-26 00:58:33 |
| 合計ジャッジ時間 | 5,643 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 12 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)
using ll = long long;
using ull = unsigned long long;
int main() {
int l = 1, r = 1'000'001;
int prv = 0;
cout << "? 0" << endl;
while (r - l > 1) {
int mid = (l + r) / 2;
int cur = 2 * mid - prv - 1;
cout << "? " << cur << endl;
int res;
cin >> res;
(res == (cur >= prv) ? l : r) = mid;
prv = cur;
}
cout << "! " << l << endl;
return 0;
}
a01sa01to