結果

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

テストケース

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

ソースコード

diff #

N = int(input())

sm = sum(range(N + 1))

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

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

print('!', *lis)
0