結果

問題 No.205 マージして辞書順最小
ユーザー yuto_teyuto_te
提出日時 2019-01-22 14:55:33
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 379 bytes
コンパイル時間 118 ms
コンパイル使用メモリ 10,592 KB
実行使用メモリ 7,972 KB
最終ジャッジ日時 2023-10-13 17:41:09
合計ジャッジ時間 1,332 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,784 KB
testcase_01 AC 14 ms
7,812 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 13 ms
7,840 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 23 ms
7,952 KB
testcase_11 AC 33 ms
7,808 KB
testcase_12 WA -
testcase_13 AC 25 ms
7,864 KB
testcase_14 AC 14 ms
7,948 KB
testcase_15 AC 13 ms
7,776 KB
testcase_16 AC 13 ms
7,828 KB
testcase_17 AC 13 ms
7,944 KB
testcase_18 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
length = 0
words = []
for _ in range(n):
    s = input()
    length += len(s)
    words.append(list(s))

t = ""
for _ in range(length):
    x = min(w for w in words)
    s = ""
    for i,w in enumerate(words):
        if x == w:
            s = words[i].pop(0)
            if len(words[i]) == 0:
                del words[i]
            break
    t += s
print(t)
0