結果

問題 No.205 マージして辞書順最小
ユーザー ああいいああいい
提出日時 2022-02-23 23:15:03
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 115 ms / 5,000 ms
コード長 252 bytes
コンパイル時間 299 ms
コンパイル使用メモリ 87,164 KB
実行使用メモリ 77,516 KB
最終ジャッジ日時 2023-09-14 16:28:29
合計ジャッジ時間 3,045 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,152 KB
testcase_01 AC 77 ms
71,060 KB
testcase_02 AC 93 ms
75,940 KB
testcase_03 AC 99 ms
75,760 KB
testcase_04 AC 90 ms
75,500 KB
testcase_05 AC 93 ms
75,724 KB
testcase_06 AC 77 ms
71,040 KB
testcase_07 AC 112 ms
77,100 KB
testcase_08 AC 112 ms
76,912 KB
testcase_09 AC 111 ms
77,404 KB
testcase_10 AC 104 ms
77,172 KB
testcase_11 AC 106 ms
77,372 KB
testcase_12 AC 115 ms
77,516 KB
testcase_13 AC 115 ms
77,132 KB
testcase_14 AC 76 ms
71,036 KB
testcase_15 AC 75 ms
71,384 KB
testcase_16 AC 74 ms
71,044 KB
testcase_17 AC 75 ms
71,112 KB
testcase_18 AC 74 ms
70,888 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
import heapq
q = []
for _ in range(N):
    S = input()
    q.append(S+"z" * 100)
heapq.heapify(q)
ans = []
while q:
    S = heapq.heappop(q)
    ans.append(S[0])
    if len(S) != 101:
        heapq.heappush(q,S[1:])
print("".join(ans))
0