結果
| 問題 | No.1512 作文 |
| コンテスト | |
| ユーザー |
titia
|
| 提出日時 | 2021-05-21 21:34:50 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 1,715 ms / 2,000 ms |
| コード長 | 323 bytes |
| 記録 | |
| コンパイル時間 | 109 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 28,636 KB |
| 最終ジャッジ日時 | 2024-10-10 08:03:51 |
| 合計ジャッジ時間 | 9,526 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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