結果

問題 No.1994 Confusing Name
ユーザー 👑 H20H20
提出日時 2022-07-01 21:58:42
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 468 ms / 2,000 ms
コード長 334 bytes
コンパイル時間 341 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 150,864 KB
最終ジャッジ日時 2024-05-04 16:24:04
合計ジャッジ時間 9,611 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 65 ms
63,744 KB
testcase_01 AC 65 ms
63,488 KB
testcase_02 AC 66 ms
63,488 KB
testcase_03 AC 67 ms
63,488 KB
testcase_04 AC 67 ms
63,104 KB
testcase_05 AC 89 ms
73,216 KB
testcase_06 AC 110 ms
77,952 KB
testcase_07 AC 72 ms
68,352 KB
testcase_08 AC 93 ms
77,952 KB
testcase_09 AC 100 ms
78,080 KB
testcase_10 AC 92 ms
77,824 KB
testcase_11 AC 80 ms
72,832 KB
testcase_12 AC 372 ms
124,424 KB
testcase_13 AC 457 ms
150,864 KB
testcase_14 AC 450 ms
144,404 KB
testcase_15 AC 372 ms
149,576 KB
testcase_16 AC 335 ms
145,104 KB
testcase_17 AC 401 ms
149,888 KB
testcase_18 AC 465 ms
147,964 KB
testcase_19 AC 463 ms
148,020 KB
testcase_20 AC 468 ms
148,172 KB
testcase_21 AC 161 ms
97,536 KB
testcase_22 AC 118 ms
83,744 KB
testcase_23 AC 409 ms
138,112 KB
testcase_24 AC 407 ms
137,344 KB
testcase_25 AC 274 ms
119,108 KB
testcase_26 AC 212 ms
105,600 KB
testcase_27 AC 449 ms
143,104 KB
testcase_28 AC 386 ms
128,216 KB
testcase_29 AC 119 ms
83,204 KB
testcase_30 AC 330 ms
139,964 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import string
import collections
N = int(input())
S = []
CA = collections.Counter()
for _ in range(N):
    S.append('a'+input()+'a')
for s in S:
    s = s
    for i in range(1,len(s)-1):
        CA[s[:i]+'*'+s[i+1:]]+=1
for s in S:
    ans = 0
    for i in range(1,len(s)-1):
        ans+=CA[s[:i]+'*'+s[i+1:]]
    print(ans-len(s)+2)
0