結果

問題 No.2252 Find Zero
ユーザー aaaaaaaaaa2230
提出日時 2023-03-24 21:36:37
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 148 ms / 2,000 ms
コード長 333 bytes
コンパイル時間 255 ms
コンパイル使用メモリ 82,196 KB
実行使用メモリ 80,416 KB
平均クエリ数 78.17
最終ジャッジ日時 2024-09-18 16:52:22
合計ジャッジ時間 3,408 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

n = int(input())

for i in range(n//2):
    x,y = 2*i,2*i+1
    print("?",x,y)
    sys.stdout.flush()

    z = int(input())
    if z == x:
        print("!",y)
        sys.stdout.flush()
        exit()
    if z == y:
        print("!",x)
        sys.stdout.flush()
        exit()
print("!",n-1)
sys.stdout.flush()

exit()
0