結果

問題 No.2124 Guess the Permutation
ユーザー takumiytakumiy
提出日時 2022-11-28 18:08:36
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 93 ms / 2,000 ms
コード長 353 bytes
コンパイル時間 86 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 27,608 KB
平均クエリ数 374.60
最終ジャッジ日時 2024-04-15 16:56:14
合計ジャッジ時間 1,713 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 57 ms
27,336 KB
testcase_01 AC 51 ms
27,608 KB
testcase_02 AC 51 ms
27,224 KB
testcase_03 AC 51 ms
26,968 KB
testcase_04 AC 55 ms
27,224 KB
testcase_05 AC 57 ms
27,480 KB
testcase_06 AC 75 ms
27,608 KB
testcase_07 AC 93 ms
27,224 KB
testcase_08 AC 93 ms
27,480 KB
testcase_09 AC 92 ms
27,352 KB
権限があれば一括ダウンロードができます

ソースコード

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 - 1):
    print('?', l, r)
    S = int(input())
    middle.append(S - prev)
    prev = S
middle.append(sm - (start + sum(middle) + end))

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