結果

問題 No.1994 Confusing Name
ユーザー MasKoaTSMasKoaTS
提出日時 2022-02-23 16:15:48
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 448 ms / 2,000 ms
コード長 367 bytes
コンパイル時間 309 ms
コンパイル使用メモリ 87,104 KB
実行使用メモリ 144,032 KB
最終ジャッジ日時 2023-09-17 05:08:03
合計ジャッジ時間 9,018 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
71,196 KB
testcase_01 AC 94 ms
71,580 KB
testcase_02 AC 83 ms
71,456 KB
testcase_03 AC 79 ms
71,480 KB
testcase_04 AC 79 ms
71,476 KB
testcase_05 AC 96 ms
77,824 KB
testcase_06 AC 113 ms
77,584 KB
testcase_07 AC 89 ms
77,240 KB
testcase_08 AC 107 ms
77,784 KB
testcase_09 AC 112 ms
78,036 KB
testcase_10 AC 99 ms
77,648 KB
testcase_11 AC 96 ms
77,656 KB
testcase_12 AC 340 ms
117,388 KB
testcase_13 AC 414 ms
142,008 KB
testcase_14 AC 419 ms
144,032 KB
testcase_15 AC 370 ms
130,896 KB
testcase_16 AC 326 ms
126,828 KB
testcase_17 AC 351 ms
130,808 KB
testcase_18 AC 443 ms
143,148 KB
testcase_19 AC 439 ms
142,828 KB
testcase_20 AC 448 ms
142,724 KB
testcase_21 AC 174 ms
91,324 KB
testcase_22 AC 139 ms
86,280 KB
testcase_23 AC 418 ms
126,068 KB
testcase_24 AC 405 ms
127,900 KB
testcase_25 AC 282 ms
108,352 KB
testcase_26 AC 192 ms
96,900 KB
testcase_27 AC 365 ms
122,076 KB
testcase_28 AC 296 ms
115,372 KB
testcase_29 AC 136 ms
85,312 KB
testcase_30 AC 315 ms
118,868 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