結果
問題 |
No.1831 Parasol
|
ユーザー |
![]() |
提出日時 | 2021-12-01 23:03:44 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 350 bytes |
コンパイル時間 | 253 ms |
コンパイル使用メモリ | 81,920 KB |
実行使用メモリ | 78,928 KB |
最終ジャッジ日時 | 2024-06-11 11:22:48 |
合計ジャッジ時間 | 5,582 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 1 |
other | AC * 1 WA * 18 |
ソースコード
import heapq n = int(input()) a = [] for i in range(1, 2 * n): a.append((-i, i)) heapq.heapify(a) print(2 * n - 1) for i in range(2 * n - 1): res = [] his = [] for j in range(n): p = heapq.heappop(a) res.append(p[1]) his.append(p) for p in his: heapq.heappush(a, (p[0] + 1, p[1])) print(*res)