結果
問題 | No.1831 Parasol |
ユーザー |
|
提出日時 | 2022-02-04 23:00:14 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 427 bytes |
コンパイル時間 | 477 ms |
コンパイル使用メモリ | 82,176 KB |
実行使用メモリ | 78,984 KB |
最終ジャッジ日時 | 2024-06-11 12:36:37 |
合計ジャッジ時間 | 5,621 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 1 |
other | WA * 19 |
ソースコード
N = int(input()) print(2 * N - 1) import heapq q = [(-(i+1),i+1) for i in range(2 * N-1)] heapq.heapify(q) print(q) for _ in range(2 * N - 1): ans = [] tmp = [] for j in range(N): n,index = heapq.heappop(q) ans.append(index) if n != -1: tmp.append((n+1,index)) for i in ans: print(i,end = " ") print() for n,index in tmp: heapq.heappush(q,(n,index))