結果

問題 No.246 質問と回答
ユーザー CleyLCleyL
提出日時 2020-01-22 19:18:25
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 369 bytes
コンパイル時間 903 ms
コンパイル使用メモリ 63,088 KB
実行使用メモリ 24,420 KB
平均クエリ数 30.00
最終ジャッジ日時 2023-09-23 19:30:03
合計ジャッジ時間 3,611 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 46 ms
23,436 KB
testcase_01 AC 39 ms
23,928 KB
testcase_02 WA -
testcase_03 AC 39 ms
24,084 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 43 ms
24,060 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 39 ms
23,640 KB
testcase_15 AC 40 ms
23,556 KB
testcase_16 AC 40 ms
23,688 KB
testcase_17 AC 40 ms
23,664 KB
testcase_18 WA -
testcase_19 AC 38 ms
24,060 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 40 ms
23,424 KB
testcase_23 WA -
testcase_24 AC 37 ms
23,256 KB
testcase_25 WA -
testcase_26 AC 39 ms
23,508 KB
testcase_27 AC 39 ms
24,084 KB
testcase_28 WA -
testcase_29 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;
int s;
int main(){
    long long mn = 1;
    long long mx = 1000000000;
    long long ce = (mn+mx)/2;
    while(mx-mn > 1){
        cout << "? " << ce << endl;
        cin>>s;
        if(s){
            mn = ce+1;
        }else{
            mx = ce;
        }
        ce = (mn+mx)/2;
    }
    cout << "! " << ce << endl;
    
}
0