結果
| 問題 |
No.2252 Find Zero
|
| コンテスト | |
| ユーザー |
momoyuu
|
| 提出日時 | 2023-03-24 21:56:11 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 76 ms / 2,000 ms |
| コード長 | 390 bytes |
| コンパイル時間 | 2,856 ms |
| コンパイル使用メモリ | 244,612 KB |
| 実行使用メモリ | 25,440 KB |
| 平均クエリ数 | 78.17 |
| 最終ジャッジ日時 | 2024-09-18 17:04:01 |
| 合計ジャッジ時間 | 5,218 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 18 |
ソースコード
#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){
if(x==i) x = i + 1;
else x = i;
cout<<"! "<<x<<endl;
return 0;
}
}
cout<<"! "<<n-1<<endl;
}
momoyuu