結果
| 問題 |
No.3212 SUPER Guess the Number
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-07-25 22:24:37 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 476 bytes |
| コンパイル時間 | 1,717 ms |
| コンパイル使用メモリ | 194,872 KB |
| 実行使用メモリ | 26,356 KB |
| 平均クエリ数 | 22.00 |
| 最終ジャッジ日時 | 2025-07-25 22:24:43 |
| 合計ジャッジ時間 | 4,218 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 12 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
int main(){
int l=1,r=1e6+1;
cout<<"? "<<l<<endl;
bool f=true;
while(r-l>1){
cout<<"? "<<(f?r:l)<<endl;
int ret;
cin>>ret;
if(ret){
if(f){
l=(l+r)/2;
f=false;
}
else{
r=(l+r)/2;
f=true;
}
}
else{
if(!f){
l=(l+r)/2;
f=false;
}
else{
r=(l+r)/2;
f=true;
}
}
}
cout<<"! "<<l<<endl;
}