結果
問題 |
No.205 マージして辞書順最小
|
ユーザー |
![]() |
提出日時 | 2020-12-18 19:47:35 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 77 ms / 5,000 ms |
コード長 | 243 bytes |
コンパイル時間 | 187 ms |
コンパイル使用メモリ | 82,516 KB |
実行使用メモリ | 74,068 KB |
最終ジャッジ日時 | 2024-09-21 09:15:41 |
合計ジャッジ時間 | 2,042 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 15 |
ソースコード
n = int(input()) r = 0 from heapq import * q = [] for _ in range(n): s = input()+"{" q.append(s) r += len(s)-1 heapify(q) ans = [] for i in range(r): s = heappop(q) ans.append(s[0]) heappush(q,s[1:]) print("".join(ans))