結果

問題 No.1994 Confusing Name
ユーザー 👑 KazunKazun
提出日時 2022-07-01 21:31:42
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 410 ms / 2,000 ms
コード長 377 bytes
コンパイル時間 256 ms
コンパイル使用メモリ 87,224 KB
実行使用メモリ 145,200 KB
最終ジャッジ日時 2023-08-17 08:51:07
合計ジャッジ時間 8,293 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,416 KB
testcase_01 AC 69 ms
71,484 KB
testcase_02 AC 69 ms
71,288 KB
testcase_03 AC 69 ms
71,292 KB
testcase_04 AC 69 ms
71,524 KB
testcase_05 AC 84 ms
76,780 KB
testcase_06 AC 94 ms
76,940 KB
testcase_07 AC 79 ms
76,264 KB
testcase_08 AC 94 ms
76,712 KB
testcase_09 AC 98 ms
77,212 KB
testcase_10 AC 92 ms
76,704 KB
testcase_11 AC 86 ms
76,856 KB
testcase_12 AC 337 ms
120,180 KB
testcase_13 AC 380 ms
142,572 KB
testcase_14 AC 394 ms
139,256 KB
testcase_15 AC 345 ms
139,152 KB
testcase_16 AC 302 ms
133,440 KB
testcase_17 AC 334 ms
138,032 KB
testcase_18 AC 409 ms
144,496 KB
testcase_19 AC 410 ms
145,060 KB
testcase_20 AC 397 ms
145,200 KB
testcase_21 AC 140 ms
88,504 KB
testcase_22 AC 120 ms
85,984 KB
testcase_23 AC 359 ms
132,976 KB
testcase_24 AC 345 ms
127,324 KB
testcase_25 AC 246 ms
119,284 KB
testcase_26 AC 157 ms
94,428 KB
testcase_27 AC 323 ms
128,096 KB
testcase_28 AC 268 ms
127,104 KB
testcase_29 AC 114 ms
84,600 KB
testcase_30 AC 279 ms
127,212 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=sys.stdin.readline
write=sys.stdout.write

N=int(input())

S=[""]*N
E={}
for i in range(N):
    S[i]=input()[:-1]

    for j in range(len(S[i])):
        T=S[i][:j]+"*"+S[i][j+1:]
        E[T]=E.get(T,0)+1

Ans=[0]*N
for i in range(N):
    for j in range(len(S[i])):
        T=S[i][:j]+"*"+S[i][j+1:]
        Ans[i]+=E.get(T)-1

write("\n".join(map(str,Ans)))
0