結果

問題 No.1994 Confusing Name
ユーザー scrappyscrappy
提出日時 2022-07-08 16:07:50
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 546 bytes
コンパイル時間 102 ms
コンパイル使用メモリ 10,748 KB
実行使用メモリ 50,764 KB
最終ジャッジ日時 2023-08-27 15:04:55
合計ジャッジ時間 39,866 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
29,604 KB
testcase_01 AC 119 ms
29,484 KB
testcase_02 AC 122 ms
29,528 KB
testcase_03 AC 119 ms
29,556 KB
testcase_04 AC 122 ms
29,588 KB
testcase_05 AC 134 ms
29,764 KB
testcase_06 AC 154 ms
29,968 KB
testcase_07 AC 125 ms
29,800 KB
testcase_08 AC 143 ms
29,808 KB
testcase_09 AC 156 ms
29,976 KB
testcase_10 AC 135 ms
29,816 KB
testcase_11 AC 135 ms
29,868 KB
testcase_12 AC 1,941 ms
50,764 KB
testcase_13 TLE -
testcase_14 TLE -
testcase_15 TLE -
testcase_16 AC 1,868 ms
44,516 KB
testcase_17 AC 1,991 ms
45,920 KB
testcase_18 TLE -
testcase_19 TLE -
testcase_20 TLE -
testcase_21 AC 595 ms
34,636 KB
testcase_22 AC 331 ms
32,184 KB
testcase_23 TLE -
testcase_24 TLE -
testcase_25 AC 1,346 ms
42,432 KB
testcase_26 AC 754 ms
36,664 KB
testcase_27 AC 1,953 ms
48,576 KB
testcase_28 AC 1,473 ms
43,408 KB
testcase_29 AC 291 ms
31,076 KB
testcase_30 AC 1,618 ms
44,800 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# No.1994 Confusing Name
import sys, time, random, string
import numpy as np

LEN = 10

N = int(input())
S = [input() for i in range(N)]

nn = np.full((N), 0)

for i in range(LEN):
    T = [s[:i]+'?'+s[i+1:] if i<len(s) else '' for s in S]
    U = sorted(zip(T, S, range(N)))

    t0 = ''
    ii = []
    for t, s, i in U:
        if t == '':
            continue

        if t == t0:
            ii += [i]
        else:
            nn[ii] += len(ii)-1
            ii = [i]
            t0 = t

    nn[ii] += len(ii)-1

for n in nn:
     print(n)
0