結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,084 KB
testcase_01 AC 76 ms
71,256 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 80 ms
71,156 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 105 ms
76,264 KB
testcase_11 AC 125 ms
77,812 KB
testcase_12 WA -
testcase_13 AC 124 ms
77,296 KB
testcase_14 AC 82 ms
71,348 KB
testcase_15 AC 81 ms
71,356 KB
testcase_16 AC 79 ms
71,156 KB
testcase_17 AC 79 ms
71,220 KB
testcase_18 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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))
0