結果
| 問題 |
No.2124 Guess the Permutation
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-11-18 21:39:20 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 126 ms / 2,000 ms |
| コード長 | 376 bytes |
| コンパイル時間 | 168 ms |
| コンパイル使用メモリ | 82,828 KB |
| 実行使用メモリ | 85,800 KB |
| 平均クエリ数 | 374.60 |
| 最終ジャッジ日時 | 2024-09-20 02:02:46 |
| 合計ジャッジ時間 | 1,852 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 9 |
ソースコード
N = int(input())
all_sum = (N * (1 + N)) // 2
P = []
ever_sum = 0
for l in range(2, N):
print(f"? {l} {N}")
kukanwa = int(input())
P.append(all_sum - kukanwa - ever_sum)
ever_sum += P[-1]
print(f"? {1} {N - 1}")
kukanwa = int(input())
P.append(all_sum - kukanwa)
for i in range(1, N + 1):
if i not in P:
P.insert(-1, i)
print("!" , *P)