結果
問題 |
No.246 質問と回答
|
ユーザー |
![]() |
提出日時 | 2015-07-17 22:37:26 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 527 bytes |
コンパイル時間 | 586 ms |
コンパイル使用メモリ | 81,456 KB |
実行使用メモリ | 25,604 KB |
平均クエリ数 | 30.97 |
最終ジャッジ日時 | 2024-07-16 06:52:23 |
合計ジャッジ時間 | 3,959 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | WA * 30 |
ソースコード
#include <iostream> #include <string> #include <vector> #include <cmath> #include <algorithm> #include <cstdlib> #include <ctime> #include <cstdio> #include <functional> #include <set> #include <sstream> #include <map> #include <queue> #include <stack> using namespace std; int main() { long long l=1,r=1000000000; while(l!=r){ //cout<<"l="<<l<<" r="<<r<<endl; long long m=(l+r)/2; cout<<"? "<<m<<endl; string res; getline(cin,res); if(res=="1") l=m+1; else r=m; } cout<<"! "<<l<<endl; return 0; }