結果

問題 No.2252 Find Zero
コンテスト
ユーザー rin204
提出日時 2024-04-29 14:32:23
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 86 ms / 2,000 ms
コード長 250 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 202 ms
コンパイル使用メモリ 85,248 KB
実行使用メモリ 80,920 KB
平均クエリ数 78.17
最終ジャッジ日時 2026-05-13 05:54:27
合計ジャッジ時間 2,901 ms
ジャッジサーバーID
(参考情報)
judge1_1 / judge3_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

def ask(x, y):
    print(f"? {x} {y}", flush=True)
    return int(input())


n = int(input())
for i in range(1, n, 2):
    res = ask(i - 1, i)
    if res == i - 1 or res == i:
        print(f"! {2 * i - 1 - res}")
        exit()

print(f"! {n - 1}")
0