結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,724 KB
testcase_01 AC 15 ms
7,848 KB
testcase_02 AC 15 ms
7,720 KB
testcase_03 AC 15 ms
7,720 KB
testcase_04 AC 565 ms
26,396 KB
testcase_05 AC 566 ms
26,560 KB
testcase_06 AC 571 ms
26,224 KB
testcase_07 AC 576 ms
26,288 KB
testcase_08 AC 573 ms
26,512 KB
testcase_09 AC 102 ms
8,260 KB
testcase_10 AC 105 ms
7,912 KB
testcase_11 AC 100 ms
8,260 KB
testcase_12 AC 105 ms
8,340 KB
testcase_13 AC 105 ms
8,196 KB
testcase_14 AC 153 ms
8,528 KB
testcase_15 AC 151 ms
8,520 KB
testcase_16 AC 154 ms
8,452 KB
testcase_17 AC 152 ms
8,588 KB
testcase_18 AC 152 ms
8,388 KB
testcase_19 AC 150 ms
8,264 KB
testcase_20 AC 151 ms
8,404 KB
testcase_21 AC 21 ms
7,780 KB
testcase_22 AC 17 ms
7,820 KB
testcase_23 AC 24 ms
7,956 KB
testcase_24 AC 25 ms
7,884 KB
testcase_25 AC 24 ms
7,720 KB
testcase_26 AC 16 ms
7,848 KB
testcase_27 AC 17 ms
7,784 KB
testcase_28 AC 16 ms
7,864 KB
testcase_29 AC 15 ms
7,752 KB
testcase_30 AC 15 ms
7,784 KB
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 AC 103 ms
8,524 KB
testcase_36 AC 95 ms
8,488 KB
testcase_37 AC 66 ms
8,416 KB
testcase_38 AC 95 ms
7,720 KB
testcase_39 AC 95 ms
7,872 KB
testcase_40 AC 854 ms
44,104 KB
testcase_41 AC 717 ms
42,880 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[0], -x[2]))

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

print(ans)
0