結果

問題 No.1994 Confusing Name
ユーザー trineutrontrineutron
提出日時 2022-07-01 21:45:35
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 360 ms / 2,000 ms
コード長 377 bytes
コンパイル時間 305 ms
コンパイル使用メモリ 87,076 KB
実行使用メモリ 117,684 KB
最終ジャッジ日時 2023-08-17 09:15:38
合計ジャッジ時間 8,612 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 93 ms
71,764 KB
testcase_01 AC 92 ms
71,684 KB
testcase_02 AC 92 ms
71,580 KB
testcase_03 AC 94 ms
71,772 KB
testcase_04 AC 94 ms
71,836 KB
testcase_05 AC 115 ms
77,232 KB
testcase_06 AC 130 ms
77,680 KB
testcase_07 AC 111 ms
77,480 KB
testcase_08 AC 123 ms
77,476 KB
testcase_09 AC 131 ms
77,456 KB
testcase_10 AC 121 ms
77,480 KB
testcase_11 AC 118 ms
77,696 KB
testcase_12 AC 311 ms
114,220 KB
testcase_13 AC 330 ms
115,372 KB
testcase_14 AC 343 ms
117,324 KB
testcase_15 AC 304 ms
110,264 KB
testcase_16 AC 283 ms
106,244 KB
testcase_17 AC 304 ms
109,592 KB
testcase_18 AC 359 ms
117,364 KB
testcase_19 AC 360 ms
117,684 KB
testcase_20 AC 359 ms
117,584 KB
testcase_21 AC 194 ms
84,232 KB
testcase_22 AC 166 ms
79,432 KB
testcase_23 AC 330 ms
110,816 KB
testcase_24 AC 325 ms
111,160 KB
testcase_25 AC 255 ms
100,500 KB
testcase_26 AC 203 ms
87,280 KB
testcase_27 AC 310 ms
107,720 KB
testcase_28 AC 260 ms
103,352 KB
testcase_29 AC 163 ms
79,568 KB
testcase_30 AC 276 ms
102,904 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict

n = int(input())
s = [input() for i in range(n)]
ans = [0] * n
for i in range(10):
    d = defaultdict(int)
    for j in range(n):
        if len(s[j]) > i:
            d[s[j][:i] + s[j][i + 1:]] += 1
    for j in range(n):
        if len(s[j]) > i:
            ans[j] += d[s[j][:i] + s[j][i + 1:]] - 1
for i in range(n):
    print(ans[i])
0