結果

問題 No.1512 作文
ユーザー 👑 H20H20
提出日時 2021-05-22 02:52:36
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 564 ms / 2,000 ms
コード長 288 bytes
コンパイル時間 332 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 109,760 KB
最終ジャッジ日時 2024-04-18 17:19:03
合計ジャッジ時間 6,161 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
52,096 KB
testcase_01 AC 33 ms
51,924 KB
testcase_02 AC 33 ms
52,096 KB
testcase_03 AC 36 ms
51,968 KB
testcase_04 AC 413 ms
94,108 KB
testcase_05 AC 402 ms
95,036 KB
testcase_06 AC 394 ms
94,088 KB
testcase_07 AC 417 ms
94,324 KB
testcase_08 AC 396 ms
94,376 KB
testcase_09 AC 70 ms
73,116 KB
testcase_10 AC 73 ms
73,796 KB
testcase_11 AC 73 ms
72,784 KB
testcase_12 AC 79 ms
73,464 KB
testcase_13 AC 72 ms
74,172 KB
testcase_14 AC 98 ms
76,400 KB
testcase_15 AC 96 ms
76,096 KB
testcase_16 AC 98 ms
76,408 KB
testcase_17 AC 99 ms
76,548 KB
testcase_18 AC 101 ms
76,580 KB
testcase_19 AC 101 ms
76,524 KB
testcase_20 AC 111 ms
76,472 KB
testcase_21 AC 46 ms
60,564 KB
testcase_22 AC 44 ms
59,452 KB
testcase_23 AC 45 ms
61,084 KB
testcase_24 AC 44 ms
60,940 KB
testcase_25 AC 45 ms
62,032 KB
testcase_26 AC 36 ms
52,768 KB
testcase_27 AC 34 ms
51,824 KB
testcase_28 AC 33 ms
54,092 KB
testcase_29 AC 34 ms
52,528 KB
testcase_30 AC 34 ms
52,832 KB
testcase_31 AC 36 ms
59,172 KB
testcase_32 AC 37 ms
59,828 KB
testcase_33 AC 36 ms
58,208 KB
testcase_34 AC 41 ms
60,416 KB
testcase_35 AC 49 ms
71,784 KB
testcase_36 AC 50 ms
71,472 KB
testcase_37 AC 42 ms
66,936 KB
testcase_38 AC 65 ms
82,704 KB
testcase_39 AC 71 ms
83,000 KB
testcase_40 AC 564 ms
109,760 KB
testcase_41 AC 311 ms
108,368 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
L = []
for i in range(N):
    S = list(input())
    if ''.join(map(str, S)) == ''.join(map(str, sorted(S))):
        L.append(S)
L.sort()
A = [0]*26
for l in L:
    begin = ord(l[0])-97
    end = ord(l[-1])-97
    A[end]=max(A[end],max(A[:begin+1])+len(l))
print(max(A))
0