結果

問題 No.2252 Find Zero
ユーザー ripity
提出日時 2023-03-24 21:59:33
言語 C++17(gcc12)
(gcc 12.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 509 bytes
コンパイル時間 19,935 ms
コンパイル使用メモリ 350,544 KB
最終ジャッジ日時 2025-02-11 17:17:38
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 15 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int N;
	cin >> N;
	for( int i = 1; i < N; i+=2 ) {
		int z;
		cout << "? " << i << ' ' << i+1 << endl;
		cin >> z;
		if( z == i ) {
			cout << "! " << i+1 << endl;
			return 0;
		}else if( z == i+1 ) {
			cout << "! " << i << endl;
		}
	}
	cout << "! " << N << endl;
}
0