結果

問題 No.253 ロウソクの長さ
ユーザー parukiparuki
提出日時 2016-07-27 11:38:34
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 997 bytes
コンパイル時間 1,452 ms
コンパイル使用メモリ 165,340 KB
実行使用メモリ 24,408 KB
平均クエリ数 68.53
最終ジャッジ日時 2023-09-23 11:13:44
合計ジャッジ時間 4,675 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
24,348 KB
testcase_01 AC 24 ms
24,336 KB
testcase_02 WA -
testcase_03 AC 25 ms
24,024 KB
testcase_04 AC 24 ms
24,060 KB
testcase_05 WA -
testcase_06 AC 25 ms
23,844 KB
testcase_07 AC 26 ms
23,520 KB
testcase_08 AC 27 ms
23,652 KB
testcase_09 AC 24 ms
24,024 KB
testcase_10 AC 27 ms
24,348 KB
testcase_11 AC 26 ms
24,036 KB
testcase_12 AC 26 ms
23,520 KB
testcase_13 AC 27 ms
23,424 KB
testcase_14 AC 23 ms
23,532 KB
testcase_15 AC 27 ms
24,336 KB
testcase_16 AC 26 ms
23,640 KB
testcase_17 AC 26 ms
23,388 KB
testcase_18 AC 26 ms
24,396 KB
testcase_19 AC 24 ms
24,048 KB
testcase_20 AC 27 ms
23,412 KB
testcase_21 AC 26 ms
23,676 KB
testcase_22 AC 26 ms
24,024 KB
testcase_23 AC 27 ms
23,844 KB
testcase_24 WA -
testcase_25 AC 26 ms
23,640 KB
testcase_26 AC 28 ms
23,532 KB
testcase_27 AC 26 ms
24,264 KB
testcase_28 AC 26 ms
23,412 KB
testcase_29 AC 25 ms
23,532 KB
testcase_30 AC 27 ms
23,376 KB
testcase_31 AC 26 ms
23,652 KB
testcase_32 AC 26 ms
24,408 KB
testcase_33 AC 27 ms
23,820 KB
testcase_34 AC 25 ms
23,412 KB
testcase_35 AC 27 ms
24,396 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"
using namespace std;
#define FOR(i,j,k) for(int (i)=(j);(i)<(int)(k);++(i))
#define rep(i,j) FOR(i,0,j)
#define each(x,y) for(auto &(x):(y))
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define debug(x) cout<<#x<<": "<<(x)<<endl
#define smax(x,y) (x)=max((x),(y))
#define smin(x,y) (x)=min((x),(y))
#define MEM(x,y) memset((x),(y),sizeof (x))
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<ll> vll;

int ask(int Y){
    cout << "? " << Y << endl;
	int res;
	cin >> res;
	return res;
}

int main(){
    for(int i = 0; i < 55; ++i){
        if(ask(0) == 0){
            cout << "! " << i << endl;
            return 0;
        }
    }
    int L = 0, R = 1000000001, cnt = 55;
    while(R - L > 1){
        int M = (L + R) / 2;
        int a = ask(max(M - cnt++, 0));
        if(a == 0)L = M, R = M + 1;
        else (a > 0 ? L : R) = M;
    }
    cout << "! " << L << endl;
    return 0;
}
0