結果

問題 No.2252 Find Zero
ユーザー lloyzlloyz
提出日時 2023-03-24 21:32:58
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 105 ms / 2,000 ms
コード長 272 bytes
コンパイル時間 299 ms
コンパイル使用メモリ 11,868 KB
実行使用メモリ 26,552 KB
平均クエリ数 78.17
最終ジャッジ日時 2023-10-18 20:49:55
合計ジャッジ時間 2,892 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 91 ms
26,544 KB
testcase_01 AC 105 ms
26,544 KB
testcase_02 AC 78 ms
26,544 KB
testcase_03 AC 92 ms
26,544 KB
testcase_04 AC 79 ms
26,544 KB
testcase_05 AC 77 ms
26,544 KB
testcase_06 AC 77 ms
26,544 KB
testcase_07 AC 79 ms
26,544 KB
testcase_08 AC 88 ms
26,552 KB
testcase_09 AC 93 ms
26,552 KB
testcase_10 AC 78 ms
26,544 KB
testcase_11 AC 76 ms
26,544 KB
testcase_12 AC 77 ms
26,544 KB
testcase_13 AC 75 ms
26,544 KB
testcase_14 AC 76 ms
26,544 KB
testcase_15 AC 76 ms
26,544 KB
testcase_16 AC 76 ms
26,544 KB
testcase_17 AC 78 ms
26,544 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())

x, y = 0, 1
for _ in range(n // 2):
    print(f"? {x} {y}")
    z = int(input())
    if z == x:
        print(f"! {y}")
        exit()
    if z == y:
        print(f"! {x}")
        exit()
    x = (x + 2) % n
    y = (y + 2) % n
print("! " + str(n - 1))
0