結果

問題 No.1994 Confusing Name
ユーザー ああいいああいい
提出日時 2022-07-01 21:41:48
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 477 ms / 2,000 ms
コード長 333 bytes
コンパイル時間 179 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 157,296 KB
最終ジャッジ日時 2024-05-04 15:59:55
合計ジャッジ時間 8,828 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 46 ms
53,504 KB
testcase_01 AC 46 ms
53,760 KB
testcase_02 AC 46 ms
53,504 KB
testcase_03 AC 46 ms
53,248 KB
testcase_04 AC 45 ms
53,248 KB
testcase_05 AC 76 ms
68,736 KB
testcase_06 AC 109 ms
77,184 KB
testcase_07 AC 62 ms
63,488 KB
testcase_08 AC 93 ms
74,240 KB
testcase_09 AC 102 ms
77,312 KB
testcase_10 AC 78 ms
69,760 KB
testcase_11 AC 76 ms
68,736 KB
testcase_12 AC 367 ms
134,016 KB
testcase_13 AC 425 ms
147,840 KB
testcase_14 AC 456 ms
148,564 KB
testcase_15 AC 399 ms
157,296 KB
testcase_16 AC 365 ms
136,320 KB
testcase_17 AC 381 ms
147,180 KB
testcase_18 AC 470 ms
149,504 KB
testcase_19 AC 477 ms
149,376 KB
testcase_20 AC 475 ms
149,760 KB
testcase_21 AC 172 ms
96,000 KB
testcase_22 AC 129 ms
82,944 KB
testcase_23 AC 428 ms
146,724 KB
testcase_24 AC 415 ms
146,944 KB
testcase_25 AC 293 ms
111,392 KB
testcase_26 AC 197 ms
104,064 KB
testcase_27 AC 380 ms
146,320 KB
testcase_28 AC 313 ms
120,952 KB
testcase_29 AC 127 ms
82,560 KB
testcase_30 AC 325 ms
127,244 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
S = [input() for _ in range(N)]
from collections import defaultdict
d = defaultdict(int)

for s in S:
    for i in range(len(s)):
        T = s[:i] + "?" + s[i + 1:]
        d[T] += 1
for s in S:
    tmp = 0
    for i in range(len(s)):
        T = s[:i] + "?" + s[i + 1:]
        tmp += d[T] - 1
    print(tmp)
    
0