結果

問題 No.1994 Confusing Name
ユーザー Kiri8128Kiri8128
提出日時 2022-07-01 21:38:27
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 469 ms / 2,000 ms
コード長 396 bytes
コンパイル時間 329 ms
コンパイル使用メモリ 87,080 KB
実行使用メモリ 143,184 KB
最終ジャッジ日時 2023-08-17 09:02:34
合計ジャッジ時間 9,326 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,072 KB
testcase_01 AC 74 ms
71,320 KB
testcase_02 AC 74 ms
71,460 KB
testcase_03 AC 72 ms
71,484 KB
testcase_04 AC 72 ms
71,068 KB
testcase_05 AC 97 ms
77,076 KB
testcase_06 AC 119 ms
78,236 KB
testcase_07 AC 84 ms
76,280 KB
testcase_08 AC 110 ms
77,848 KB
testcase_09 AC 112 ms
78,056 KB
testcase_10 AC 99 ms
77,508 KB
testcase_11 AC 97 ms
77,044 KB
testcase_12 AC 387 ms
120,404 KB
testcase_13 AC 428 ms
137,548 KB
testcase_14 AC 429 ms
143,184 KB
testcase_15 AC 379 ms
136,160 KB
testcase_16 AC 341 ms
121,796 KB
testcase_17 AC 375 ms
125,828 KB
testcase_18 AC 458 ms
137,604 KB
testcase_19 AC 466 ms
137,680 KB
testcase_20 AC 469 ms
137,684 KB
testcase_21 AC 177 ms
94,104 KB
testcase_22 AC 134 ms
82,920 KB
testcase_23 AC 405 ms
131,664 KB
testcase_24 AC 410 ms
130,652 KB
testcase_25 AC 291 ms
113,436 KB
testcase_26 AC 213 ms
102,108 KB
testcase_27 AC 375 ms
126,296 KB
testcase_28 AC 307 ms
117,460 KB
testcase_29 AC 132 ms
82,272 KB
testcase_30 AC 318 ms
119,588 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

alp = "abcdefghijklmnopqrstuvwxyz"
N = int(input())
X = []
D = {}
for _ in range(N):
    a = input()
    l = len(a)
    for i in range(l):
        b = a[:i] + "_" + a[i+1:]
        if b in D:
            D[b] += 1
        else:
            D[b] = 1
    X.append(a)
for x in X:
    l = len(x)
    ans = -l
    for i in range(l):
        y = x[:i] + "_" + x[i+1:]
        ans += D[y]
    print(ans)
0