結果

問題 No.2124 Guess the Permutation
ユーザー takumiytakumiy
提出日時 2022-11-28 18:06:00
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 353 bytes
コンパイル時間 185 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 27,864 KB
平均クエリ数 373.80
最終ジャッジ日時 2024-04-15 16:54:25
合計ジャッジ時間 1,842 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 57 ms
27,080 KB
testcase_01 AC 53 ms
26,840 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())

sm = sum(range(N + 1))

print('?', 2, N)
start = sm - int(input())

print('?', 1, N - 1)
end = sm - int(input())

middle = []
prev = start
l = 1
for r in range(2, N - 2):
    print('?', l, r)
    S = int(input())
    middle.append(S - prev)
    prev = S
middle.append(sm - (start + sum(middle) + end))

print('!', start, *middle, end)
0