結果

問題 No.1512 作文
ユーザー 330Xs330Xs
提出日時 2022-02-04 18:18:46
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 556 bytes
コンパイル時間 171 ms
コンパイル使用メモリ 10,884 KB
実行使用メモリ 82,496 KB
最終ジャッジ日時 2023-09-02 04:21:07
合計ジャッジ時間 16,205 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 135 ms
29,620 KB
testcase_02 AC 132 ms
29,696 KB
testcase_03 AC 132 ms
29,656 KB
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 AC 147 ms
29,944 KB
testcase_10 AC 146 ms
30,016 KB
testcase_11 AC 147 ms
29,852 KB
testcase_12 AC 146 ms
30,076 KB
testcase_13 AC 147 ms
29,940 KB
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 AC 130 ms
29,556 KB
testcase_22 AC 131 ms
29,604 KB
testcase_23 RE -
testcase_24 RE -
testcase_25 RE -
testcase_26 AC 131 ms
29,548 KB
testcase_27 AC 131 ms
29,424 KB
testcase_28 RE -
testcase_29 RE -
testcase_30 RE -
testcase_31 RE -
testcase_32 RE -
testcase_33 RE -
testcase_34 RE -
testcase_35 AC 233 ms
32,456 KB
testcase_36 AC 233 ms
32,400 KB
testcase_37 AC 189 ms
31,704 KB
testcase_38 RE -
testcase_39 RE -
testcase_40 WA -
testcase_41 AC 1,128 ms
82,496 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np
n = int(input())
lis = []
for _ in range(n):
    a = list(map(str,input()))
    flag = True
    for i in range(len(a)-1):
        if(a[i] > a[i+1]):
            flag = False
            break
    if(flag):
        lis.append(a)

if(len(lis) == 0):
    print(0)
else:
    lis_sort = np.sort(lis,axis=-1)
    i = 0
    j = 1
    ans = len(lis_sort[0])
    while((i < len(lis)) & (j < len(lis))):
        if(lis_sort[i][-1] <= lis_sort[j][0]):
            ans += len(lis_sort[j])
            i = j
        j += 1
    print(ans)
            
0