結果
| 問題 | No.2124 Guess the Permutation |
| コンテスト | |
| ユーザー |
detteiuu
|
| 提出日時 | 2026-05-07 23:40:26 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 91 ms / 2,000 ms |
| コード長 | 293 bytes |
| 記録 | |
| コンパイル時間 | 271 ms |
| コンパイル使用メモリ | 85,376 KB |
| 実行使用メモリ | 89,376 KB |
| 平均クエリ数 | 374.60 |
| 最終ジャッジ日時 | 2026-05-07 23:40:29 |
| 合計ジャッジ時間 | 2,114 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 9 |
ソースコード
def question(l, r):
print("?", l+1, r+1)
return int(input())
def answer(P):
print("!", *P)
N = int(input())
ans = [((1+N)*N//2)-question(1, N-1)]
SUM = ans[0]
for i in range(1, N-1):
ans.append(question(0, i)-SUM)
SUM += ans[-1]
ans.append(((1+N)*N//2)-SUM)
answer(ans)
detteiuu