結果
| 問題 |
No.1512 作文
|
| コンテスト | |
| ユーザー |
titia
|
| 提出日時 | 2021-05-21 21:35:13 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 466 ms / 2,000 ms |
| コード長 | 323 bytes |
| コンパイル時間 | 321 ms |
| コンパイル使用メモリ | 82,364 KB |
| 実行使用メモリ | 104,004 KB |
| 最終ジャッジ日時 | 2024-10-10 08:04:39 |
| 合計ジャッジ時間 | 5,983 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 38 |
ソースコード
import sys
input = sys.stdin.readline
N=int(input())
L=[]
for i in range(N):
S=list(input().strip())
if S==sorted(S):
L.append(S)
DP=[0]*26
L.sort()
for s in L:
init=ord(s[0])-97
end=ord(s[-1])-97
xx=DP[init]+len(s)
for j in range(end,26):
DP[j]=max(DP[j],xx)
print(max(DP))
titia