結果

問題 No.1512 作文
ユーザー ああいい
提出日時 2021-12-31 18:49:24
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 318 bytes
コンパイル時間 360 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 25,504 KB
最終ジャッジ日時 2024-10-08 19:55:51
合計ジャッジ時間 7,648 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 28 WA * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

N = int(input())
l = []
for _ in range(N):
    S = input()
    T = list(S)
    if sorted(T) == T:
        l.append((T[-1],-len(T),T[0]))
        
now = 'a'
ans = 0
l.sort()
if len(l) == 0:
    print(0)
    exit()
    
for e,length,s in l:
    if now <= s:
        ans += -length
        now = e
print(ans)
0