結果

問題 No.2252 Find Zero
ユーザー kotatsugame
提出日時 2023-03-24 21:22:05
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 74 ms / 2,000 ms
コード長 245 bytes
コンパイル時間 778 ms
コンパイル使用メモリ 65,704 KB
実行使用メモリ 25,220 KB
平均クエリ数 78.17
最終ジャッジ日時 2024-09-18 16:38:45
合計ジャッジ時間 2,775 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

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