結果
| 問題 | No.205 マージして辞書順最小 |
| コンテスト | |
| ユーザー |
yaoshimax
|
| 提出日時 | 2015-05-24 14:35:01 |
| 言語 | PyPy2 (7.3.20) |
| 結果 |
AC
|
| 実行時間 | 85 ms / 5,000 ms |
| コード長 | 231 bytes |
| 記録 | |
| コンパイル時間 | 553 ms |
| コンパイル使用メモリ | 81,208 KB |
| 実行使用メモリ | 83,456 KB |
| 最終ジャッジ日時 | 2026-03-27 17:57:45 |
| 合計ジャッジ時間 | 2,634 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 15 |
ソースコード
from heapq import heappop,heappush
N=int(raw_input())
hp=[]
for i in range(N):
S=raw_input()
heappush(hp,S+"{")
ans=""
while len(hp)!=0:
s=heappop(hp)
ans+=s[0]
if len(s)>2:
heappush(hp,s[1:])
print ans
yaoshimax