結果

問題 No.1994 Confusing Name
ユーザー MasKoaTSMasKoaTS
提出日時 2021-12-29 13:42:28
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 861 ms / 2,000 ms
コード長 367 bytes
コンパイル時間 111 ms
コンパイル使用メモリ 10,648 KB
実行使用メモリ 40,372 KB
最終ジャッジ日時 2023-09-17 05:09:00
合計ジャッジ時間 12,734 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
8,464 KB
testcase_01 AC 19 ms
8,604 KB
testcase_02 AC 19 ms
8,416 KB
testcase_03 AC 18 ms
8,412 KB
testcase_04 AC 19 ms
8,492 KB
testcase_05 AC 23 ms
8,884 KB
testcase_06 AC 30 ms
9,112 KB
testcase_07 AC 21 ms
8,576 KB
testcase_08 AC 27 ms
9,020 KB
testcase_09 AC 30 ms
9,324 KB
testcase_10 AC 24 ms
8,928 KB
testcase_11 AC 24 ms
8,696 KB
testcase_12 AC 627 ms
34,164 KB
testcase_13 AC 817 ms
39,000 KB
testcase_14 AC 802 ms
39,660 KB
testcase_15 AC 692 ms
35,872 KB
testcase_16 AC 596 ms
33,316 KB
testcase_17 AC 670 ms
35,388 KB
testcase_18 AC 857 ms
40,200 KB
testcase_19 AC 841 ms
40,208 KB
testcase_20 AC 861 ms
40,372 KB
testcase_21 AC 174 ms
15,364 KB
testcase_22 AC 92 ms
12,008 KB
testcase_23 AC 733 ms
35,968 KB
testcase_24 AC 708 ms
35,380 KB
testcase_25 AC 455 ms
24,796 KB
testcase_26 AC 234 ms
17,104 KB
testcase_27 AC 666 ms
33,820 KB
testcase_28 AC 495 ms
33,072 KB
testcase_29 AC 78 ms
11,772 KB
testcase_30 AC 541 ms
33,188 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from collections import defaultdict as dfd
input = sys.stdin.readline

n = int(input())
d = dfd(int)
user = []
for _ in [0]*n:
	s = input().rstrip()
	user.append(s)
	for i in range(len(s)):
		t = ''.join([s[:i],'.',s[(i+1):]])
		d[t] += 1

for s in user:
	ans = 0
	for i in range(len(s)):
		t = ''.join([s[:i],'.',s[(i+1):]])
		ans += d[t] - 1
	print(ans)
0