結果

問題 No.1994 Confusing Name
ユーザー tassei903tassei903
提出日時 2022-07-01 22:35:44
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 669 ms / 2,000 ms
コード長 827 bytes
コンパイル時間 337 ms
コンパイル使用メモリ 87,240 KB
実行使用メモリ 141,588 KB
最終ジャッジ日時 2023-08-17 10:08:02
合計ジャッジ時間 12,397 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 94 ms
71,556 KB
testcase_01 AC 93 ms
71,552 KB
testcase_02 AC 94 ms
71,788 KB
testcase_03 AC 94 ms
71,808 KB
testcase_04 AC 95 ms
71,436 KB
testcase_05 AC 114 ms
77,840 KB
testcase_06 AC 121 ms
77,784 KB
testcase_07 AC 105 ms
77,652 KB
testcase_08 AC 119 ms
77,888 KB
testcase_09 AC 119 ms
77,968 KB
testcase_10 AC 120 ms
77,936 KB
testcase_11 AC 114 ms
77,868 KB
testcase_12 AC 473 ms
116,568 KB
testcase_13 AC 611 ms
137,088 KB
testcase_14 AC 594 ms
135,780 KB
testcase_15 AC 514 ms
127,020 KB
testcase_16 AC 474 ms
121,044 KB
testcase_17 AC 531 ms
126,548 KB
testcase_18 AC 651 ms
139,720 KB
testcase_19 AC 645 ms
140,644 KB
testcase_20 AC 669 ms
141,588 KB
testcase_21 AC 217 ms
90,372 KB
testcase_22 AC 171 ms
81,856 KB
testcase_23 AC 568 ms
126,028 KB
testcase_24 AC 562 ms
122,764 KB
testcase_25 AC 395 ms
110,920 KB
testcase_26 AC 257 ms
92,528 KB
testcase_27 AC 524 ms
121,740 KB
testcase_28 AC 422 ms
115,032 KB
testcase_29 AC 158 ms
81,856 KB
testcase_30 AC 452 ms
117,424 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