結果

問題 No.1994 Confusing Name
ユーザー 👑 H20H20
提出日時 2022-07-01 21:58:42
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 517 ms / 2,000 ms
コード長 334 bytes
コンパイル時間 317 ms
コンパイル使用メモリ 87,156 KB
実行使用メモリ 160,988 KB
最終ジャッジ日時 2023-08-17 09:33:04
合計ジャッジ時間 11,552 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 153 ms
80,100 KB
testcase_01 AC 152 ms
80,096 KB
testcase_02 AC 152 ms
80,112 KB
testcase_03 AC 152 ms
80,152 KB
testcase_04 AC 150 ms
80,236 KB
testcase_05 AC 170 ms
81,720 KB
testcase_06 AC 180 ms
81,760 KB
testcase_07 AC 168 ms
81,304 KB
testcase_08 AC 176 ms
81,860 KB
testcase_09 AC 178 ms
81,772 KB
testcase_10 AC 176 ms
81,692 KB
testcase_11 AC 173 ms
81,776 KB
testcase_12 AC 431 ms
141,012 KB
testcase_13 AC 499 ms
148,724 KB
testcase_14 AC 500 ms
159,724 KB
testcase_15 AC 448 ms
160,988 KB
testcase_16 AC 405 ms
138,896 KB
testcase_17 AC 452 ms
155,368 KB
testcase_18 AC 514 ms
154,364 KB
testcase_19 AC 512 ms
154,396 KB
testcase_20 AC 517 ms
154,416 KB
testcase_21 AC 234 ms
97,000 KB
testcase_22 AC 209 ms
88,376 KB
testcase_23 AC 478 ms
152,656 KB
testcase_24 AC 482 ms
152,280 KB
testcase_25 AC 359 ms
118,380 KB
testcase_26 AC 272 ms
110,152 KB
testcase_27 AC 438 ms
149,852 KB
testcase_28 AC 370 ms
123,444 KB
testcase_29 AC 204 ms
87,440 KB
testcase_30 AC 409 ms
135,612 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import string
import collections
N = int(input())
S = []
CA = collections.Counter()
for _ in range(N):
    S.append('a'+input()+'a')
for s in S:
    s = s
    for i in range(1,len(s)-1):
        CA[s[:i]+'*'+s[i+1:]]+=1
for s in S:
    ans = 0
    for i in range(1,len(s)-1):
        ans+=CA[s[:i]+'*'+s[i+1:]]
    print(ans-len(s)+2)
0