結果

問題 No.1512 作文
ユーザー otsunekootsuneko
提出日時 2021-05-21 21:53:42
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 459 bytes
コンパイル時間 238 ms
コンパイル使用メモリ 82,228 KB
実行使用メモリ 145,564 KB
最終ジャッジ日時 2024-04-18 15:12:43
合計ジャッジ時間 6,966 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
52,480 KB
testcase_01 AC 40 ms
52,352 KB
testcase_02 AC 39 ms
52,224 KB
testcase_03 AC 39 ms
52,736 KB
testcase_04 AC 519 ms
121,324 KB
testcase_05 AC 516 ms
121,932 KB
testcase_06 AC 522 ms
121,704 KB
testcase_07 AC 515 ms
121,448 KB
testcase_08 AC 536 ms
121,580 KB
testcase_09 AC 42 ms
53,632 KB
testcase_10 AC 40 ms
53,760 KB
testcase_11 AC 41 ms
53,760 KB
testcase_12 AC 40 ms
53,632 KB
testcase_13 AC 40 ms
53,760 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 40 ms
52,864 KB
testcase_22 AC 39 ms
52,608 KB
testcase_23 AC 41 ms
52,608 KB
testcase_24 AC 41 ms
53,248 KB
testcase_25 AC 42 ms
52,992 KB
testcase_26 AC 39 ms
52,608 KB
testcase_27 AC 39 ms
52,224 KB
testcase_28 AC 39 ms
52,352 KB
testcase_29 AC 39 ms
52,224 KB
testcase_30 AC 39 ms
52,480 KB
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 AC 49 ms
71,936 KB
testcase_36 AC 49 ms
71,936 KB
testcase_37 AC 48 ms
66,432 KB
testcase_38 AC 58 ms
72,940 KB
testcase_39 AC 55 ms
73,152 KB
testcase_40 AC 572 ms
145,564 KB
testcase_41 AC 251 ms
124,652 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from operator import itemgetter
import sys
input = lambda: sys.stdin.readline().rstrip()
INF = 10**18

N = int(input())
l = []
for i in range(N):
    S = input()
    l.append([S[0],S[-1],S])
l.sort(key=itemgetter(0,1))

ans = 0
last = "a"
for S in l:
    if S[0] < last:
        continue
    for i in range(len(S[2])-1):
        if S[2][i] > S[2][i+1]:
            break
    else:
        ans += len(S[2])
        last = S[1]
print(ans)
0