結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
24,036 KB
testcase_01 WA -
testcase_02 AC 26 ms
24,048 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 26 ms
23,520 KB
testcase_07 AC 26 ms
23,400 KB
testcase_08 AC 26 ms
23,376 KB
testcase_09 WA -
testcase_10 AC 27 ms
23,532 KB
testcase_11 AC 26 ms
23,532 KB
testcase_12 AC 29 ms
24,348 KB
testcase_13 AC 25 ms
23,628 KB
testcase_14 WA -
testcase_15 AC 26 ms
24,048 KB
testcase_16 WA -
testcase_17 AC 25 ms
23,532 KB
testcase_18 AC 26 ms
24,012 KB
testcase_19 WA -
testcase_20 AC 26 ms
24,036 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 27 ms
24,048 KB
testcase_24 AC 26 ms
23,376 KB
testcase_25 AC 28 ms
24,264 KB
testcase_26 AC 28 ms
24,336 KB
testcase_27 AC 26 ms
24,312 KB
testcase_28 AC 26 ms
23,400 KB
testcase_29 AC 26 ms
24,384 KB
testcase_30 AC 26 ms
23,400 KB
testcase_31 AC 25 ms
23,412 KB
testcase_32 AC 26 ms
24,492 KB
testcase_33 AC 26 ms
24,024 KB
testcase_34 WA -
testcase_35 AC 26 ms
23,664 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 < 35; ++i){
        if(ask(0) == 0){
            cout << i << endl;
            return 0;
        }
    }
    int L = 0, R = 1000000001, cnt = 35;
    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