結果

問題 No.246 質問と回答
ユーザー KKT89
提出日時 2020-07-17 13:18:07
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 70 ms / 2,000 ms
コード長 567 bytes
コンパイル時間 934 ms
コンパイル使用メモリ 107,236 KB
最終ジャッジ日時 2025-01-11 21:45:16
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <queue>
#include <cstdio>
#include <ctime>
#include <assert.h>
#include <chrono>
#include <random>
#include <numeric>
#include <set>
using namespace std;
typedef long long int ll;
typedef unsigned long long ull;


int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    ll l=1,r=1e9+1;
    while(r-l>1){
        ll mid=(l+r)/2;
        cout << "? " << mid << endl;
        int k; cin >> k;
        if(k)l=mid;
        else r=mid; 
    }
    cout << "! " << l << endl;
}
0