結果

問題 No.1994 Confusing Name
ユーザー ああいいああいい
提出日時 2022-07-01 21:41:48
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 497 ms / 2,000 ms
コード長 333 bytes
コンパイル時間 446 ms
コンパイル使用メモリ 87,040 KB
実行使用メモリ 158,156 KB
最終ジャッジ日時 2023-08-17 09:08:30
合計ジャッジ時間 9,827 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 95 ms
71,688 KB
testcase_01 AC 96 ms
71,828 KB
testcase_02 AC 95 ms
71,608 KB
testcase_03 AC 95 ms
71,688 KB
testcase_04 AC 96 ms
71,324 KB
testcase_05 AC 120 ms
77,944 KB
testcase_06 AC 140 ms
77,968 KB
testcase_07 AC 107 ms
77,392 KB
testcase_08 AC 131 ms
77,792 KB
testcase_09 AC 137 ms
78,092 KB
testcase_10 AC 122 ms
77,984 KB
testcase_11 AC 120 ms
77,340 KB
testcase_12 AC 382 ms
134,472 KB
testcase_13 AC 449 ms
156,520 KB
testcase_14 AC 454 ms
157,728 KB
testcase_15 AC 402 ms
145,436 KB
testcase_16 AC 366 ms
126,132 KB
testcase_17 AC 398 ms
135,076 KB
testcase_18 AC 483 ms
157,944 KB
testcase_19 AC 497 ms
158,152 KB
testcase_20 AC 478 ms
158,156 KB
testcase_21 AC 196 ms
94,256 KB
testcase_22 AC 165 ms
88,716 KB
testcase_23 AC 393 ms
147,240 KB
testcase_24 AC 400 ms
146,504 KB
testcase_25 AC 300 ms
123,632 KB
testcase_26 AC 219 ms
104,240 KB
testcase_27 AC 364 ms
136,860 KB
testcase_28 AC 296 ms
122,344 KB
testcase_29 AC 154 ms
86,076 KB
testcase_30 AC 333 ms
122,856 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