結果
| 問題 |
No.246 質問と回答
|
| コンテスト | |
| ユーザー |
spade630
|
| 提出日時 | 2015-10-19 11:52:42 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 378 bytes |
| コンパイル時間 | 718 ms |
| コンパイル使用メモリ | 54,704 KB |
| 実行使用メモリ | 25,740 KB |
| 平均クエリ数 | 30.87 |
| 最終ジャッジ日時 | 2024-07-16 07:50:01 |
| 合計ジャッジ時間 | 4,416 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 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 = 0, ub = INF, res;
while(ub - lb > 1){
int mid = (lb + ub) / 2;
cout << "? " << mid << endl;
cin >> res;
if(res){
lb = mid;
}
else{
ub = mid;
}
}
cout << "! " << ub << endl;
fflush(stdin);
return 0;
}
spade630