結果
問題 | No.246 質問と回答 |
ユーザー |
![]() |
提出日時 | 2015-09-28 19:01:29 |
言語 | C++11 (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 839 bytes |
コンパイル時間 | 819 ms |
コンパイル使用メモリ | 90,176 KB |
実行使用メモリ | 25,604 KB |
平均クエリ数 | 30.00 |
最終ジャッジ日時 | 2024-07-16 07:49:21 |
合計ジャッジ時間 | 3,664 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | WA * 30 |
ソースコード
#include <iostream> #include <sstream> #include <vector> #include <cmath> #include <map> #include <unordered_map> #include <set> #include <unordered_set> #include <bitset> #include <iomanip> #include <algorithm> #include <queue> #include <numeric> #include <functional> using namespace std; #define REP(i, n) for(int i = 0; i < (int)(n); i++) #define FOR(i,n,m) for (int i=n; i<(int)(m); i++) #define INF 1000000007 typedef long long ll; typedef long double ld; ll dy[4]={-1,1,0,0}; ll dx[4]={0,0,1,-1}; int main(){ int ub = INF; int lb = 0; bool ans=false; while(ub - lb > 1){ int mid = (ub+lb)/2; cout << "?" << mid << endl; cin >> ans; if(ans) lb=mid; else ub=mid; } if(ans) cout << "!" << ub << endl; else cout << "!" << lb << endl; return 0; }