結果

問題 No.2252 Find Zero
ユーザー yupooh
提出日時 2023-03-24 21:29:32
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 416 bytes
コンパイル時間 342 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 78,048 KB
平均クエリ数 77.83
最終ジャッジ日時 2024-09-18 16:46:07
合計ジャッジ時間 3,334 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 13 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
n=int(input())
for i in range(n//2-1):
  print("?",i*2,i*2+1,flush=True)
  z=int(input())
  if z==i*2:
    print("!",i*2+1,flush=True)
    exit()
  elif z==i*2+1:
    print("!",i*2,flush=True)
    exit()
x=(n//2-2)*2+2
if n%2==1:
  print("!",x,flush=True)
  exit()
print("?",x,x-1,flush=True)
z=int(input())
if z==x-1:
  print("!",x,flush=True)
else:
  print("!",x+1,flush=True)
0