結果

問題 No.2252 Find Zero
ユーザー momoyuu
提出日時 2023-03-24 21:55:10
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 335 bytes
コンパイル時間 2,421 ms
コンパイル使用メモリ 244,840 KB
実行使用メモリ 25,580 KB
平均クエリ数 78.17
最終ジャッジ日時 2024-09-18 17:03:24
合計ジャッジ時間 4,418 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 4 WA * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
using ll = long long;

int main(){
    int n;
    cin>>n;

    for(int i = 0;i<n-1;i+=2){
        cout<<"? "<<i<<" "<<i+1<<endl;
        int x;
        cin>>x;
        if(x==i||x==i+1){
            cout<<"! "<<x<<endl;
            return 0;
        }
    }
    cout<<"! "<<n-1<<endl;
}   

0