結果

問題 No.205 マージして辞書順最小
ユーザー roiti46roiti46
提出日時 2015-05-08 23:45:24
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 351 bytes
コンパイル時間 561 ms
コンパイル使用メモリ 6,580 KB
実行使用メモリ 6,088 KB
最終ジャッジ日時 2023-09-19 08:58:50
合計ジャッジ時間 1,658 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
5,884 KB
testcase_01 AC 11 ms
5,924 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 11 ms
5,932 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 20 ms
5,804 KB
testcase_11 AC 20 ms
6,088 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 12 ms
5,928 KB
testcase_16 AC 11 ms
5,928 KB
testcase_17 WA -
testcase_18 AC 12 ms
5,932 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(raw_input())
S = sorted([raw_input() for i in xrange(N)])
T = ""

for i in xrange(N):
    s = S.pop(0)
    j = 0
    for si in s:
        for i in xrange(j, len(T)):
            if T[i] > si:
                T = T[:i] + si + T[i:]
                j = i + 1
                break
        else:
            T += si
            j = i + 1
print T
0