結果

問題 No.1512 作文
ユーザー brthyyjpbrthyyjp
提出日時 2021-05-21 21:27:58
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 401 ms / 2,000 ms
コード長 409 bytes
コンパイル時間 176 ms
コンパイル使用メモリ 81,844 KB
実行使用メモリ 111,876 KB
最終ジャッジ日時 2024-04-18 14:28:55
合計ジャッジ時間 5,316 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
53,172 KB
testcase_01 AC 33 ms
52,612 KB
testcase_02 AC 37 ms
52,616 KB
testcase_03 AC 37 ms
53,184 KB
testcase_04 AC 321 ms
95,284 KB
testcase_05 AC 320 ms
95,128 KB
testcase_06 AC 322 ms
94,992 KB
testcase_07 AC 321 ms
94,612 KB
testcase_08 AC 325 ms
94,896 KB
testcase_09 AC 67 ms
75,672 KB
testcase_10 AC 67 ms
75,872 KB
testcase_11 AC 65 ms
75,848 KB
testcase_12 AC 68 ms
76,492 KB
testcase_13 AC 63 ms
76,220 KB
testcase_14 AC 73 ms
77,052 KB
testcase_15 AC 72 ms
76,960 KB
testcase_16 AC 75 ms
77,200 KB
testcase_17 AC 74 ms
76,672 KB
testcase_18 AC 72 ms
76,876 KB
testcase_19 AC 72 ms
77,012 KB
testcase_20 AC 70 ms
76,780 KB
testcase_21 AC 40 ms
60,120 KB
testcase_22 AC 37 ms
59,448 KB
testcase_23 AC 39 ms
61,432 KB
testcase_24 AC 43 ms
62,036 KB
testcase_25 AC 41 ms
61,888 KB
testcase_26 AC 36 ms
52,932 KB
testcase_27 AC 37 ms
53,604 KB
testcase_28 AC 38 ms
51,888 KB
testcase_29 AC 33 ms
52,336 KB
testcase_30 AC 38 ms
52,204 KB
testcase_31 AC 39 ms
58,288 KB
testcase_32 AC 37 ms
59,020 KB
testcase_33 AC 37 ms
58,292 KB
testcase_34 AC 39 ms
62,100 KB
testcase_35 AC 59 ms
82,668 KB
testcase_36 AC 55 ms
82,096 KB
testcase_37 AC 54 ms
80,816 KB
testcase_38 AC 54 ms
75,596 KB
testcase_39 AC 54 ms
75,652 KB
testcase_40 AC 401 ms
111,876 KB
testcase_41 AC 190 ms
110,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
import io, os
input = sys.stdin.readline

n = int(input())
S = [input().rstrip() for i in range(n)]
X = [0]*26
T = []
for s in S:
    temp = []
    for c in s:
        temp.append(ord(c)-ord('a'))
    if sorted(temp) != temp:
        continue
    T.append((temp[0], temp[-1], len(s)))
if not T:
    print(0)
    exit()
T.sort()
for p, q, l in T:
    X[q] = max(X[q], max(X[0:p+1])+l)
print(max(X))
0