結果
| 問題 |
No.1512 作文
|
| コンテスト | |
| ユーザー |
SidewaysOwl
|
| 提出日時 | 2021-11-28 19:52:56 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 367 bytes |
| コンパイル時間 | 165 ms |
| コンパイル使用メモリ | 82,176 KB |
| 実行使用メモリ | 82,304 KB |
| 最終ジャッジ日時 | 2024-07-01 14:54:34 |
| 合計ジャッジ時間 | 7,178 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 RE * 1 |
| other | AC * 15 WA * 17 RE * 6 |
ソースコード
n = int(input())
from collections import defaultdict
d = defaultdict(int)
for _ in range(n):
s = list(input())
if s != sorted(s):
continue
d_k = list(d.keys())
for k in d_k:
if s[0] < k:
pass
else:
d[s[-1]] = max(d[k] + len(s),d[s[-1]])
d[s[-1]] = max(len(s),d[s[-1]])
print(max(d.values()))
SidewaysOwl