結果

問題 No.1512 作文
ユーザー brthyyjpbrthyyjp
提出日時 2021-05-21 21:27:58
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 480 ms / 2,000 ms
コード長 409 bytes
コンパイル時間 441 ms
コンパイル使用メモリ 86,896 KB
実行使用メモリ 112,712 KB
最終ジャッジ日時 2023-07-31 14:24:44
合計ジャッジ時間 7,770 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,160 KB
testcase_01 AC 74 ms
71,236 KB
testcase_02 AC 72 ms
71,308 KB
testcase_03 AC 74 ms
71,500 KB
testcase_04 AC 371 ms
95,840 KB
testcase_05 AC 372 ms
96,284 KB
testcase_06 AC 374 ms
95,896 KB
testcase_07 AC 373 ms
96,260 KB
testcase_08 AC 377 ms
95,608 KB
testcase_09 AC 102 ms
77,232 KB
testcase_10 AC 102 ms
77,444 KB
testcase_11 AC 102 ms
77,040 KB
testcase_12 AC 105 ms
77,768 KB
testcase_13 AC 102 ms
77,104 KB
testcase_14 AC 111 ms
78,396 KB
testcase_15 AC 110 ms
78,212 KB
testcase_16 AC 109 ms
78,320 KB
testcase_17 AC 110 ms
78,208 KB
testcase_18 AC 107 ms
78,304 KB
testcase_19 AC 109 ms
78,424 KB
testcase_20 AC 108 ms
77,992 KB
testcase_21 AC 77 ms
75,640 KB
testcase_22 AC 77 ms
75,772 KB
testcase_23 AC 79 ms
75,696 KB
testcase_24 AC 78 ms
75,884 KB
testcase_25 AC 79 ms
75,980 KB
testcase_26 AC 72 ms
71,552 KB
testcase_27 AC 73 ms
71,260 KB
testcase_28 AC 73 ms
71,324 KB
testcase_29 AC 73 ms
71,344 KB
testcase_30 AC 73 ms
71,328 KB
testcase_31 AC 78 ms
75,532 KB
testcase_32 AC 78 ms
75,776 KB
testcase_33 AC 79 ms
75,856 KB
testcase_34 AC 78 ms
75,924 KB
testcase_35 AC 95 ms
91,212 KB
testcase_36 AC 96 ms
91,596 KB
testcase_37 AC 91 ms
85,032 KB
testcase_38 AC 90 ms
76,684 KB
testcase_39 AC 91 ms
76,780 KB
testcase_40 AC 480 ms
112,712 KB
testcase_41 AC 238 ms
111,072 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