結果

問題 No.205 マージして辞書順最小
ユーザー rlangevinrlangevin
提出日時 2023-08-30 08:54:49
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 405 ms / 5,000 ms
コード長 290 bytes
コンパイル時間 349 ms
コンパイル使用メモリ 87,084 KB
実行使用メモリ 77,452 KB
最終ジャッジ日時 2023-08-30 08:54:54
合計ジャッジ時間 3,714 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,336 KB
testcase_01 AC 69 ms
71,276 KB
testcase_02 AC 84 ms
75,352 KB
testcase_03 AC 94 ms
75,212 KB
testcase_04 AC 84 ms
75,232 KB
testcase_05 AC 84 ms
75,364 KB
testcase_06 AC 69 ms
71,324 KB
testcase_07 AC 116 ms
77,320 KB
testcase_08 AC 117 ms
76,728 KB
testcase_09 AC 110 ms
77,092 KB
testcase_10 AC 405 ms
77,128 KB
testcase_11 AC 318 ms
77,452 KB
testcase_12 AC 262 ms
77,368 KB
testcase_13 AC 138 ms
77,228 KB
testcase_14 AC 69 ms
71,276 KB
testcase_15 AC 69 ms
71,600 KB
testcase_16 AC 68 ms
71,320 KB
testcase_17 AC 69 ms
71,540 KB
testcase_18 AC 68 ms
71,456 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
cnt = 0
S = []
for i in range(N):
    temp = [ord(s) - ord("a") for s in input()]
    temp.append(27)
    S.append(temp)
    cnt += len(temp) - 1

S.sort()
ans = []
for _ in range(cnt):
    v = S[0].pop(0)
    ans.append(chr(v + ord("a")))
    S.sort()

print(*ans, sep="")
0