結果

問題 No.1512 作文
ユーザー 👑 SPD_9X2SPD_9X2
提出日時 2021-05-21 21:26:54
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 188 ms / 2,000 ms
コード長 402 bytes
コンパイル時間 338 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 89,524 KB
最終ジャッジ日時 2024-04-18 14:26:57
合計ジャッジ時間 3,993 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
52,096 KB
testcase_01 AC 38 ms
52,224 KB
testcase_02 AC 37 ms
51,712 KB
testcase_03 AC 42 ms
51,968 KB
testcase_04 AC 141 ms
82,788 KB
testcase_05 AC 144 ms
82,532 KB
testcase_06 AC 139 ms
82,944 KB
testcase_07 AC 138 ms
82,664 KB
testcase_08 AC 139 ms
83,068 KB
testcase_09 AC 38 ms
53,504 KB
testcase_10 AC 38 ms
53,760 KB
testcase_11 AC 38 ms
53,120 KB
testcase_12 AC 39 ms
53,504 KB
testcase_13 AC 39 ms
52,864 KB
testcase_14 AC 67 ms
76,232 KB
testcase_15 AC 69 ms
76,168 KB
testcase_16 AC 71 ms
76,160 KB
testcase_17 AC 71 ms
76,152 KB
testcase_18 AC 71 ms
76,416 KB
testcase_19 AC 72 ms
76,288 KB
testcase_20 AC 70 ms
76,160 KB
testcase_21 AC 37 ms
51,968 KB
testcase_22 AC 35 ms
51,968 KB
testcase_23 AC 37 ms
51,968 KB
testcase_24 AC 38 ms
52,224 KB
testcase_25 AC 37 ms
52,480 KB
testcase_26 AC 37 ms
52,096 KB
testcase_27 AC 36 ms
52,224 KB
testcase_28 AC 38 ms
51,840 KB
testcase_29 AC 45 ms
51,840 KB
testcase_30 AC 40 ms
52,224 KB
testcase_31 AC 46 ms
57,728 KB
testcase_32 AC 41 ms
57,984 KB
testcase_33 AC 40 ms
57,984 KB
testcase_34 AC 44 ms
59,136 KB
testcase_35 AC 48 ms
71,424 KB
testcase_36 AC 45 ms
71,296 KB
testcase_37 AC 44 ms
65,664 KB
testcase_38 AC 50 ms
72,580 KB
testcase_39 AC 52 ms
72,680 KB
testcase_40 AC 188 ms
89,524 KB
testcase_41 AC 110 ms
82,868 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

"""

"""

import sys
from sys import stdin

N = int(stdin.readline())

S = []

for i in range(N):

    s = stdin.readline()[:-1]

    for i in range(len(s)-1):
        if s[i] > s[i+1]:
            break
    else:
        S.append(s)

S.sort()

dp = [0] * 26

for i in S:
    dp[ord(i[-1])-ord('a')] = max( dp[ord(i[-1])-ord('a')],max(dp[:ord(i[0])-ord('a')+1]) + len(i))

#print (dp)
print (max(dp))
0