結果

問題 No.1994 Confusing Name
ユーザー scrappyscrappy
提出日時 2022-07-08 15:51:05
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 638 bytes
コンパイル時間 78 ms
コンパイル使用メモリ 10,984 KB
実行使用メモリ 50,860 KB
最終ジャッジ日時 2023-08-27 14:47:45
合計ジャッジ時間 42,257 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 136 ms
29,652 KB
testcase_01 AC 134 ms
29,652 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 135 ms
29,664 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 TLE -
testcase_13 TLE -
testcase_14 TLE -
testcase_15 TLE -
testcase_16 AC 1,882 ms
44,348 KB
testcase_17 TLE -
testcase_18 TLE -
testcase_19 TLE -
testcase_20 TLE -
testcase_21 WA -
testcase_22 WA -
testcase_23 TLE -
testcase_24 TLE -
testcase_25 WA -
testcase_26 WA -
testcase_27 TLE -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

LEN = 10

#sys.stdin = open(r"C:\Users\takah\Downloads\7564-testcase\test_in\3_hand01.txt")

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
    if ii:
        nn[ii] += len(ii)-1

for n in nn:
    print(n)
0