結果

問題 No.1994 Confusing Name
ユーザー tassei903tassei903
提出日時 2022-07-01 22:35:44
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 552 ms / 2,000 ms
コード長 827 bytes
コンパイル時間 900 ms
コンパイル使用メモリ 82,224 KB
実行使用メモリ 138,496 KB
最終ジャッジ日時 2024-05-04 16:57:07
合計ジャッジ時間 9,541 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,888 KB
testcase_01 AC 38 ms
53,376 KB
testcase_02 AC 38 ms
53,760 KB
testcase_03 AC 39 ms
54,016 KB
testcase_04 AC 38 ms
53,888 KB
testcase_05 AC 55 ms
67,072 KB
testcase_06 AC 60 ms
71,424 KB
testcase_07 AC 48 ms
63,360 KB
testcase_08 AC 60 ms
69,888 KB
testcase_09 AC 63 ms
71,552 KB
testcase_10 AC 63 ms
71,552 KB
testcase_11 AC 56 ms
67,968 KB
testcase_12 AC 400 ms
117,504 KB
testcase_13 AC 492 ms
132,980 KB
testcase_14 AC 528 ms
138,496 KB
testcase_15 AC 404 ms
126,336 KB
testcase_16 AC 366 ms
117,248 KB
testcase_17 AC 415 ms
125,888 KB
testcase_18 AC 527 ms
135,892 KB
testcase_19 AC 525 ms
136,584 KB
testcase_20 AC 552 ms
135,916 KB
testcase_21 AC 142 ms
87,168 KB
testcase_22 AC 100 ms
80,768 KB
testcase_23 AC 471 ms
126,800 KB
testcase_24 AC 440 ms
121,704 KB
testcase_25 AC 305 ms
109,056 KB
testcase_26 AC 192 ms
92,928 KB
testcase_27 AC 402 ms
118,380 KB
testcase_28 AC 312 ms
111,304 KB
testcase_29 AC 91 ms
78,976 KB
testcase_30 AC 359 ms
110,976 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda :sys.stdin.readline()[:-1]
ni = lambda :int(input())
na = lambda :list(map(int,input().split()))
yes = lambda :print("yes");Yes = lambda :print("Yes");YES = lambda : print("YES")
no = lambda :print("no");No = lambda :print("No");NO = lambda : print("NO")
#######################################################################
n = ni()
s = [input() for i in range(n)]
from collections import defaultdict
d = [defaultdict(int) for j in range(10)]
f = defaultdict(int)
for i in range(n):
    z = len(s[i])
    y = list(s[i])
    for j in range(z):
        x = y.copy()
        x.pop(j)
        d[j]["".join(x)] += 1

for i in range(n):
    z = len(s[i])
    y = list(s[i])
    ans = 0
    for j in range(z):
        x = y.copy()
        x.pop(j)
        ans += d[j]["".join(x)]
    print(ans-len(s[i]))
0