結果

問題 No.2252 Find Zero
ユーザー kotatsugamekotatsugame
提出日時 2023-03-24 21:22:05
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 76 ms / 2,000 ms
コード長 245 bytes
コンパイル時間 517 ms
コンパイル使用メモリ 64,292 KB
実行使用メモリ 24,672 KB
平均クエリ数 78.17
最終ジャッジ日時 2023-10-18 20:38:40
合計ジャッジ時間 2,719 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<iostream>
using namespace std;
int N;
int main()
{
	cin>>N;
	for(int i=0;i+1<N;i+=2)
	{
		cout<<"? "<<i<<" "<<i+1<<endl;
		int k;cin>>k;
		if(k==i||k==i+1)
		{
			cout<<"! "<<i+i+1-k<<endl;
			return 0;
		}
	}
	cout<<"! "<<N-1<<endl;
}
0