結果
| 問題 |
No.205 マージして辞書順最小
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-02-23 23:05:44 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 240 bytes |
| コンパイル時間 | 306 ms |
| コンパイル使用メモリ | 82,176 KB |
| 実行使用メモリ | 76,672 KB |
| 最終ジャッジ日時 | 2024-07-01 23:31:05 |
| 合計ジャッジ時間 | 2,483 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 WA * 1 |
| other | AC * 7 WA * 8 |
ソースコード
N = int(input())
import heapq
q = []
for _ in range(N):
S = input()
q.append(S)
heapq.heapify(q)
ans = []
while q:
S = heapq.heappop(q)
ans.append(S[0])
if len(S) != 1:
heapq.heappush(q,S[1:])
print("".join(ans))