結果
| 問題 | No.2252 Find Zero |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-03-24 21:36:31 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 45 ms / 2,000 ms |
| コード長 | 704 bytes |
| 記録 | |
| コンパイル時間 | 1,356 ms |
| コンパイル使用メモリ | 209,444 KB |
| 実行使用メモリ | 30,020 KB |
| 平均クエリ数 | 78.17 |
| 最終ジャッジ日時 | 2026-06-30 01:38:57 |
| 合計ジャッジ時間 | 3,368 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 18 |
ソースコード
// 提出時にassertはオフ
#ifndef DEBUG
#ifndef NDEBUG
#define NDEBUG
#endif
#endif
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define ALL(x) (x).begin(), (x).end()
template <class T> using vec = vector<T>;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int N;
cin >> N;
for(int i = 0; i < N - 1; i += 2) {
cout << "? " << i << " " << i + 1 << endl;
int ans;
cin >> ans;
if(ans == i) {
cout << "! " << i + 1 << endl;
return 0;
}
if(ans == i + 1) {
cout << "! " << i << endl;
return 0;
}
}
cout << "! " << N - 1 << endl;
}