結果

問題 No.205 マージして辞書順最小
ユーザー ああいいああいい
提出日時 2022-02-23 23:14:12
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 244 bytes
コンパイル時間 489 ms
コンパイル使用メモリ 86,952 KB
実行使用メモリ 77,340 KB
最終ジャッジ日時 2023-09-14 16:28:06
合計ジャッジ時間 3,304 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,112 KB
testcase_01 AC 77 ms
71,048 KB
testcase_02 WA -
testcase_03 AC 97 ms
75,588 KB
testcase_04 AC 93 ms
75,552 KB
testcase_05 AC 93 ms
75,724 KB
testcase_06 AC 78 ms
71,224 KB
testcase_07 AC 114 ms
77,188 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 102 ms
76,784 KB
testcase_11 AC 106 ms
77,200 KB
testcase_12 AC 116 ms
77,292 KB
testcase_13 AC 116 ms
77,340 KB
testcase_14 AC 77 ms
71,336 KB
testcase_15 AC 78 ms
71,108 KB
testcase_16 AC 77 ms
71,108 KB
testcase_17 AC 74 ms
70,904 KB
testcase_18 AC 75 ms
71,020 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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