結果

問題 No.3011 あ、俺こいつの役やりたい!
ユーザー it_is_a_pity_
提出日時 2025-01-25 19:54:28
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 24 ms / 2,000 ms
コード長 645 bytes
コンパイル時間 3,217 ms
コンパイル使用メモリ 218,888 KB
実行使用メモリ 25,984 KB
平均クエリ数 30.93
最終ジャッジ日時 2025-01-26 00:04:15
合計ジャッジ時間 6,368 ms
ジャッジサーバーID
(参考情報)
judge5 / judge12
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 44
権限があれば一括ダウンロードができます

ソースコード

diff #

#ifdef LOCAL
#define _GLIBCXX_DEBUG
#endif
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace atcoder;
using namespace std;
#define ll long long
#define rep(i,n) for(ll i=0;i<(ll)n;i++)
#define all(v) v.begin(),v.end()
const ll INF = (ll)2e18;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);

    ll ok = 1;
    ll ng = (ll)1e9 + 1;
    ll remain = 30;

    while(ng-ok>1&&remain){
        ll m = (ng + ok) / 2;
        cout << m << endl;
        ll num;
        cin >> num;
        if(num==1){
            ok = m;
        }
        else{
            ng = m;
        }
        remain--;
    }
    cout << ok << endl;
}
0