結果

問題 No.1512 作文
ユーザー irumo8202irumo8202
提出日時 2022-02-13 15:43:28
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 495 bytes
コンパイル時間 940 ms
コンパイル使用メモリ 10,872 KB
実行使用メモリ 44,104 KB
最終ジャッジ日時 2023-09-11 15:32:06
合計ジャッジ時間 10,684 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,808 KB
testcase_01 AC 16 ms
7,860 KB
testcase_02 AC 16 ms
7,876 KB
testcase_03 AC 16 ms
7,816 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 101 ms
8,156 KB
testcase_10 AC 104 ms
8,200 KB
testcase_11 AC 101 ms
8,316 KB
testcase_12 AC 105 ms
8,184 KB
testcase_13 AC 105 ms
8,140 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 22 ms
7,784 KB
testcase_22 AC 18 ms
7,872 KB
testcase_23 AC 24 ms
7,804 KB
testcase_24 AC 26 ms
7,748 KB
testcase_25 AC 25 ms
7,940 KB
testcase_26 AC 16 ms
7,784 KB
testcase_27 AC 16 ms
7,796 KB
testcase_28 AC 16 ms
7,780 KB
testcase_29 AC 16 ms
7,796 KB
testcase_30 AC 16 ms
7,860 KB
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 AC 103 ms
8,516 KB
testcase_36 AC 95 ms
8,588 KB
testcase_37 AC 67 ms
8,504 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 AC 885 ms
44,104 KB
testcase_41 AC 737 ms
42,688 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())

def check(word):
    flg = True
    mi, mx = 'z', 'a'
    for s in word:
        if s < mx:
            flg = False
        mi = min(mi, s)
        mx = max(mx, s)
    return (flg, mi, mx, len(S))

lis = []

for i in range(N):
    S = input()
    ok, mi, mx, ln = check(S)
    if ok:
        lis.append([mi, mx, ln])

lis.sort(key=lambda x: (x[1], -x[2]))

ans = 0
last = 'a'
for mi, mx, leng in lis:
    if last > mi:
        continue
    ans += leng
    last = mx

print(ans)
0