結果
| 問題 | No.246 質問と回答 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-12-08 14:03:27 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 60 ms / 2,000 ms |
| コード長 | 397 bytes |
| 記録 | |
| コンパイル時間 | 651 ms |
| コンパイル使用メモリ | 80,808 KB |
| 実行使用メモリ | 25,996 KB |
| 平均クエリ数 | 30.90 |
| 最終ジャッジ日時 | 2025-12-08 14:03:32 |
| 合計ジャッジ時間 | 4,900 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 30 |
ソースコード
#include <iostream>
using namespace std;
int main(void){
long long min=1,max=1000000000;
while(true){
cout<<"? "<<(min+max+1)/2<<endl;
int a;
cin>>a;
if(a==1){
min=(min+max+1)/2;
}else{
max=(min+max+1)/2-1;
}
if(min==max){
cout<<"! "<<min<<endl;
break;
}
}
return 0;
}