結果
問題 | No.2124 Guess the Permutation |
ユーザー |
|
提出日時 | 2022-11-28 18:08:36 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 90 ms / 2,000 ms |
コード長 | 353 bytes |
コンパイル時間 | 119 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 27,352 KB |
平均クエリ数 | 374.60 |
最終ジャッジ日時 | 2024-10-05 17:38:32 |
合計ジャッジ時間 | 1,642 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 9 |
ソースコード
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)