結果

問題 No.2252 Find Zero
ユーザー 👑 rin204rin204
提出日時 2024-04-29 14:32:23
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 121 ms / 2,000 ms
コード長 250 bytes
コンパイル時間 181 ms
コンパイル使用メモリ 82,416 KB
実行使用メモリ 77,536 KB
平均クエリ数 78.17
最終ジャッジ日時 2024-04-29 14:32:28
合計ジャッジ時間 3,420 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 98 ms
69,600 KB
testcase_01 AC 121 ms
77,536 KB
testcase_02 AC 82 ms
68,832 KB
testcase_03 AC 100 ms
70,752 KB
testcase_04 AC 101 ms
69,208 KB
testcase_05 AC 82 ms
68,824 KB
testcase_06 AC 82 ms
68,184 KB
testcase_07 AC 83 ms
68,696 KB
testcase_08 AC 94 ms
70,376 KB
testcase_09 AC 105 ms
70,880 KB
testcase_10 AC 84 ms
68,312 KB
testcase_11 AC 83 ms
68,352 KB
testcase_12 AC 84 ms
68,960 KB
testcase_13 AC 81 ms
68,184 KB
testcase_14 AC 82 ms
68,304 KB
testcase_15 AC 103 ms
68,184 KB
testcase_16 AC 80 ms
68,312 KB
testcase_17 AC 82 ms
68,824 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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