結果

問題 No.1994 Confusing Name
ユーザー nohakai3nohakai3
提出日時 2022-07-28 21:05:12
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 956 ms / 2,000 ms
コード長 341 bytes
コンパイル時間 94 ms
コンパイル使用メモリ 10,780 KB
実行使用メモリ 40,280 KB
最終ジャッジ日時 2023-09-25 14:36:36
合計ジャッジ時間 15,881 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
8,452 KB
testcase_01 AC 18 ms
8,532 KB
testcase_02 AC 19 ms
8,548 KB
testcase_03 AC 18 ms
8,624 KB
testcase_04 AC 19 ms
8,496 KB
testcase_05 AC 24 ms
8,804 KB
testcase_06 AC 31 ms
9,176 KB
testcase_07 AC 20 ms
8,608 KB
testcase_08 AC 28 ms
9,020 KB
testcase_09 AC 33 ms
9,192 KB
testcase_10 AC 25 ms
8,760 KB
testcase_11 AC 24 ms
8,868 KB
testcase_12 AC 736 ms
34,036 KB
testcase_13 AC 927 ms
39,004 KB
testcase_14 AC 874 ms
39,816 KB
testcase_15 AC 738 ms
35,816 KB
testcase_16 AC 649 ms
33,336 KB
testcase_17 AC 727 ms
35,492 KB
testcase_18 AC 941 ms
40,196 KB
testcase_19 AC 945 ms
40,268 KB
testcase_20 AC 956 ms
40,280 KB
testcase_21 AC 196 ms
15,428 KB
testcase_22 AC 102 ms
12,108 KB
testcase_23 AC 813 ms
36,140 KB
testcase_24 AC 796 ms
35,432 KB
testcase_25 AC 517 ms
24,940 KB
testcase_26 AC 259 ms
16,960 KB
testcase_27 AC 747 ms
33,948 KB
testcase_28 AC 549 ms
33,016 KB
testcase_29 AC 84 ms
11,820 KB
testcase_30 AC 613 ms
33,196 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict as dfd

n=int(input())
d=dfd(int)
user=[]
for _ in [0]*n:
    s=input()
    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