結果
| 問題 |
No.246 質問と回答
|
| コンテスト | |
| ユーザー |
spade630
|
| 提出日時 | 2015-10-19 11:53:39 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 64 ms / 2,000 ms |
| コード長 | 364 bytes |
| コンパイル時間 | 449 ms |
| コンパイル使用メモリ | 55,540 KB |
| 実行使用メモリ | 25,476 KB |
| 平均クエリ数 | 30.90 |
| 最終ジャッジ日時 | 2024-07-16 19:56:18 |
| 合計ジャッジ時間 | 4,107 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 30 |
ソースコード
#include <iostream>
#include <cstdio>
using namespace std;
const int INF = 1e+9;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int lb = 1, ub = INF+1, res;
while(ub - lb > 1){
int mid = (lb + ub) / 2;
cout << "? " << mid << endl;
cin >> res;
if(res){
lb = mid;
}
else{
ub = mid;
}
}
cout << "! " << lb << endl;
return 0;
}
spade630