結果

問題 No.1994 Confusing Name
ユーザー roarisroaris
提出日時 2022-10-29 17:20:55
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 622 ms / 2,000 ms
コード長 406 bytes
コンパイル時間 260 ms
コンパイル使用メモリ 87,032 KB
実行使用メモリ 155,344 KB
最終ジャッジ日時 2023-09-20 20:21:39
合計ジャッジ時間 11,475 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 92 ms
71,608 KB
testcase_01 AC 91 ms
71,728 KB
testcase_02 AC 93 ms
71,772 KB
testcase_03 AC 93 ms
71,576 KB
testcase_04 AC 92 ms
71,844 KB
testcase_05 AC 111 ms
78,044 KB
testcase_06 AC 117 ms
77,560 KB
testcase_07 AC 103 ms
77,344 KB
testcase_08 AC 114 ms
77,960 KB
testcase_09 AC 116 ms
77,688 KB
testcase_10 AC 118 ms
77,744 KB
testcase_11 AC 111 ms
77,940 KB
testcase_12 AC 441 ms
119,840 KB
testcase_13 AC 572 ms
151,208 KB
testcase_14 AC 581 ms
148,472 KB
testcase_15 AC 502 ms
139,700 KB
testcase_16 AC 443 ms
125,308 KB
testcase_17 AC 504 ms
134,436 KB
testcase_18 AC 622 ms
155,344 KB
testcase_19 AC 617 ms
155,260 KB
testcase_20 AC 594 ms
155,272 KB
testcase_21 AC 195 ms
93,248 KB
testcase_22 AC 147 ms
85,284 KB
testcase_23 AC 505 ms
134,852 KB
testcase_24 AC 508 ms
133,616 KB
testcase_25 AC 353 ms
108,308 KB
testcase_26 AC 233 ms
96,560 KB
testcase_27 AC 475 ms
127,172 KB
testcase_28 AC 390 ms
114,376 KB
testcase_29 AC 143 ms
84,496 KB
testcase_30 AC 422 ms
118,816 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
from collections import *

N = int(input())
S = [input()[:-1] for _ in range(N)]
cnt = defaultdict(int)

for Si in S:
    for i in range(len(Si)):
        T = list(Si)
        T[i] = '.'
        cnt[''.join(T)] += 1

for Si in S:
    ans = 0
    
    for i in range(len(Si)):
        T = list(Si)
        T[i] = '.'
        ans += cnt[''.join(T)]-1
    
    print(ans)
0