結果

問題 No.2252 Find Zero
ユーザー houren
提出日時 2023-03-24 21:31:41
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 831 bytes
コンパイル時間 1,505 ms
コンパイル使用メモリ 167,080 KB
実行使用メモリ 25,776 KB
平均クエリ数 2.00
最終ジャッジ日時 2024-09-18 16:48:16
合計ジャッジ時間 3,677 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
#define fix(x) fixed << setprecision(x)
#define asc(x) x, vector<x>, greater<x>
#define rep(i, n) for(ll i = 0; i < n; i++)
#define all(x) (x).begin(),(x).end()
template<class T>bool chmin(T&a, const T&b){if(a>b){a=b;return 1;}return 0;}
template<class T>bool chmax(T&a, const T&b){if(a<b){a=b;return 1;}return 0;}
constexpr ll INFLL = (1LL << 62), MOD = 998244353;
constexpr int INF = (1 << 30);

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n, res;
    cin >> n;
    rep(i,n/2){
        cout << 2*i << " " << 2*i+1 << endl;
        cin >> res;
        if(res/2==i){
            cout << "! " << i*2 + ((res&1)^1) << endl;
            return 0;
        }
    }
    cout << "! " << n-1 << endl;
    return 0;
}
0