結果

問題 No.253 ロウソクの長さ
ユーザー tanimani364tanimani364
提出日時 2019-12-05 09:39:01
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,282 bytes
コンパイル時間 1,235 ms
コンパイル使用メモリ 129,956 KB
実行使用メモリ 24,504 KB
平均クエリ数 30.64
最終ジャッジ日時 2023-09-23 19:14:00
合計ジャッジ時間 6,257 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 55 ms
23,436 KB
testcase_01 AC 28 ms
24,300 KB
testcase_02 AC 28 ms
23,652 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 27 ms
23,664 KB
testcase_06 AC 26 ms
23,436 KB
testcase_07 AC 27 ms
24,336 KB
testcase_08 AC 27 ms
24,360 KB
testcase_09 WA -
testcase_10 AC 27 ms
24,348 KB
testcase_11 AC 27 ms
24,396 KB
testcase_12 AC 28 ms
24,492 KB
testcase_13 AC 27 ms
24,492 KB
testcase_14 WA -
testcase_15 AC 27 ms
24,384 KB
testcase_16 WA -
testcase_17 AC 28 ms
24,384 KB
testcase_18 AC 29 ms
23,376 KB
testcase_19 WA -
testcase_20 AC 27 ms
24,360 KB
testcase_21 AC 30 ms
24,384 KB
testcase_22 WA -
testcase_23 AC 27 ms
24,384 KB
testcase_24 AC 27 ms
23,400 KB
testcase_25 AC 29 ms
23,652 KB
testcase_26 AC 29 ms
24,372 KB
testcase_27 AC 27 ms
24,252 KB
testcase_28 AC 27 ms
24,024 KB
testcase_29 AC 27 ms
24,048 KB
testcase_30 AC 29 ms
23,388 KB
testcase_31 AC 27 ms
23,628 KB
testcase_32 AC 26 ms
23,424 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 AC 28 ms
24,024 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<cstdio>
#include<cmath>
#include<numeric>
#include<queue>
#include<stack>
#include<cstring>
#include<limits>
#include<functional>
#include<unordered_set>
#include<iomanip>
#include<cassert>
#include<regex>
#define rep(i,a) for(int i=(int)0;i<(int)a;++i)
#define pb push_back
#define eb emplace_back
using ll=long long;
constexpr ll mod = 1e9 + 7;
constexpr ll INF = 1LL << 50;
 
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
using namespace std;

int C(int mid){
    cout<<"? "<<mid<<endl;
    int res;
    cin>>res;
    return res;
}
void solve(){
    int l=10,r=1e9;
    int cnt=0;
    int x;
    rep(i,100){
        int mid=(l+r)/2;
        if(mid-cnt>=0)x=C(mid-cnt);
        else break;
        if(x==-1)r=mid;
        else if(x==1)l=mid;
        else {
            cout<<"! "<<mid<<endl;
            return ;
        }
        ++cnt;
    }
}
 
int main(){
	ios::sync_with_stdio(false);
    cin.tie(0);
	cout<<fixed<<setprecision(15);
	solve();
	return 0;
}
0