結果

問題 No.850 企業コンテスト2位
ユーザー tktk_snsn
提出日時 2021-11-07 14:33:28
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
RE  
実行時間 -
コード長 390 bytes
コンパイル時間 89 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 27,864 KB
平均クエリ数 144.18
最終ジャッジ日時 2024-11-13 23:45:06
合計ジャッジ時間 5,961 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 1
other AC * 2 WA * 2 RE * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
cand = list(range(1, N + 1))

while len(cand) > 2:
    nxt = []
    while len(cand) >= 2:
        a = cand.pop()
        b = cand.pop()
        print("? {} {}".format(a, b))
        ans = int(input())
        nxt.append(ans)
    if cand:
        nxt.append(cand)
    cand = nxt

a, b = cand
print("? {} {}".format(a, b))
ans = int(input())
print("! {}".format(a ^ b ^ ans))
0