結果
問題 |
No.246 質問と回答
|
ユーザー |
![]() |
提出日時 | 2015-10-06 13:29:42 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 53 ms / 2,000 ms |
コード長 | 1,374 bytes |
コンパイル時間 | 798 ms |
コンパイル使用メモリ | 89,108 KB |
実行使用メモリ | 25,532 KB |
平均クエリ数 | 30.87 |
最終ジャッジ日時 | 2024-07-16 19:55:48 |
合計ジャッジ時間 | 3,765 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 30 |
ソースコード
#include <iostream> #include <cstdio> #include <cstdlib> #include <cmath> #include <climits> #include <cfloat> #include <utility> #include <memory> #include <functional> #include <deque> #include <cctype> #include <numeric> #include <ctime> #include <bitset> #include <cctype> #include <vector> #include <map> #include <set> #include <stack> #include <queue> #include <cstring> #include <string> #include <sstream> #include <algorithm> #include <iomanip> using namespace std; //define #define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl; #define dump(x) cerr << #x << " = " << (x) << endl; #define INF (INT_MAX/2) #define PI (2*acos(0.0)) #define EPS (1e-8) #define REP(i,a,b) for(int i=(a); i<(b);++i) #define rep(i,n) REP(i,0,n) typedef long long ll; typedef unsigned long long ull; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef vector<int> vint; typedef vector<vector<int> > vvint; typedef vector<ll> vll; typedef vector<vector<ll> > vvll; int dx[8] = {0, 1, 0, -1, 1, -1, 1, -1}; int dy[8] = {1, 0, -1, 0, 1, -1, -1, 1}; int main(void){ ios_base::sync_with_stdio(0); ll lb = 0, ub = 1000000001; while(lb + 1 < ub){ ll mid = (lb + ub) / 2; cout << "? " << mid << endl; int ans; cin >> ans; if(ans) lb = mid; else ub = mid; } cout << "! " << lb << endl; return 0; }