結果

問題 No.2252 Find Zero
ユーザー mkawa2mkawa2
提出日時 2023-03-24 21:28:48
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 107 ms / 2,000 ms
コード長 226 bytes
コンパイル時間 72 ms
コンパイル使用メモリ 11,836 KB
実行使用メモリ 26,564 KB
平均クエリ数 78.17
最終ジャッジ日時 2023-10-18 20:45:26
合計ジャッジ時間 2,923 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

def ask(i,j):
    print("?",i,j,flush=True)
    return int(input())

n=int(input())

for i in range(0,n-1,2):
    j=ask(i,i+1)
    if i==j or i+1==j:
        print("!",j^1,flush=True)
        exit()

print("!",n-1,flush=True)
0