結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,132 KB
testcase_01 AC 77 ms
71,276 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 75 ms
71,128 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 98 ms
76,264 KB
testcase_11 AC 117 ms
77,592 KB
testcase_12 WA -
testcase_13 AC 113 ms
77,088 KB
testcase_14 AC 76 ms
71,040 KB
testcase_15 AC 74 ms
71,120 KB
testcase_16 AC 72 ms
71,416 KB
testcase_17 AC 73 ms
71,108 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) != 2:
        heapq.heappush(q,S[1:])
print("".join(ans))
0