結果

問題 No.2252 Find Zero
ユーザー ripityripity
提出日時 2023-03-24 21:59:33
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 509 bytes
コンパイル時間 6,141 ms
コンパイル使用メモリ 298,960 KB
実行使用メモリ 24,516 KB
平均クエリ数 195.44
最終ジャッジ日時 2023-10-18 21:03:12
合計ジャッジ時間 8,727 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
24,516 KB
testcase_01 AC 73 ms
24,516 KB
testcase_02 WA -
testcase_03 AC 63 ms
24,516 KB
testcase_04 AC 54 ms
24,516 KB
testcase_05 AC 53 ms
24,516 KB
testcase_06 AC 54 ms
24,516 KB
testcase_07 AC 53 ms
24,516 KB
testcase_08 AC 61 ms
24,516 KB
testcase_09 AC 65 ms
24,516 KB
testcase_10 WA -
testcase_11 AC 52 ms
24,516 KB
testcase_12 AC 52 ms
24,516 KB
testcase_13 AC 52 ms
24,516 KB
testcase_14 WA -
testcase_15 AC 53 ms
24,516 KB
testcase_16 AC 52 ms
24,516 KB
testcase_17 AC 54 ms
24,516 KB
権限があれば一括ダウンロードができます

ソースコード

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