結果

問題 No.246 質問と回答
ユーザー mint6421mint6421
提出日時 2019-08-27 22:59:38
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 883 bytes
コンパイル時間 1,400 ms
コンパイル使用メモリ 164,976 KB
実行使用メモリ 24,348 KB
平均クエリ数 30.53
最終ジャッジ日時 2023-09-23 18:07:46
合計ジャッジ時間 4,590 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
23,628 KB
testcase_01 WA -
testcase_02 AC 39 ms
23,988 KB
testcase_03 AC 40 ms
24,228 KB
testcase_04 AC 40 ms
23,544 KB
testcase_05 WA -
testcase_06 AC 38 ms
23,460 KB
testcase_07 AC 37 ms
23,604 KB
testcase_08 AC 38 ms
23,340 KB
testcase_09 WA -
testcase_10 AC 38 ms
24,324 KB
testcase_11 WA -
testcase_12 AC 38 ms
23,544 KB
testcase_13 AC 38 ms
23,964 KB
testcase_14 AC 39 ms
24,288 KB
testcase_15 WA -
testcase_16 AC 40 ms
24,012 KB
testcase_17 AC 41 ms
23,340 KB
testcase_18 AC 40 ms
24,192 KB
testcase_19 AC 41 ms
23,604 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 39 ms
23,616 KB
testcase_24 WA -
testcase_25 AC 38 ms
23,388 KB
testcase_26 AC 40 ms
24,192 KB
testcase_27 AC 40 ms
23,388 KB
testcase_28 AC 39 ms
23,748 KB
testcase_29 AC 40 ms
23,364 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#define inf INT_MAX
#define INF LLONG_MAX
#define ll long long
#define ull unsigned long long
#define M (int)(1e9+7)
#define P pair<int,int>
#define PLL pair<ll,ll>
#define FOR(i,m,n) for(int i=(int)m;i<(int)n;i++)
#define RFOR(i,m,n) for(int i=(int)m;i>=(int)n;i--)
#define rep(i,n) FOR(i,0,n)
#define rrep(i,n) RFOR(i,n,0)
#define all(a) a.begin(),a.end()
#define IN(a,n) rep(i,n){ cin>>a[i]; }
const int vx[4] = {0,1,0,-1};
const int vy[4] = {1,0,-1,0};
#define PI 3.14159265
#define F first
#define S second
#define PB push_back
#define EB emplace_back
#define int ll
#define vi vector<int>



signed main(){
  cin.tie(0);
  ios::sync_with_stdio(false);

  int l=0,r=(int)1e9+1;

  while(r-l>1){
    int m=(r+l)/2;
    cout<<"? "<<m<<endl;
    int res;
    cin>>res;
    if(res==1) l=m;
    else r=m-1;
  }

  cout<<"! "<<l<<endl;

}
0