結果

問題 No.1994 Confusing Name
ユーザー roarisroaris
提出日時 2022-10-29 17:11:39
言語 PyPy3
(7.3.15)
結果
MLE  
実行時間 -
コード長 452 bytes
コンパイル時間 167 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 593,844 KB
最終ジャッジ日時 2024-07-06 15:05:18
合計ジャッジ時間 5,404 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 48 ms
69,248 KB
testcase_01 AC 47 ms
63,232 KB
testcase_02 AC 46 ms
63,232 KB
testcase_03 AC 40 ms
53,632 KB
testcase_04 AC 39 ms
53,888 KB
testcase_05 AC 97 ms
89,424 KB
testcase_06 AC 142 ms
96,084 KB
testcase_07 AC 72 ms
81,408 KB
testcase_08 AC 123 ms
93,408 KB
testcase_09 AC 154 ms
99,052 KB
testcase_10 AC 98 ms
90,324 KB
testcase_11 AC 96 ms
90,112 KB
testcase_12 MLE -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
権限があれば一括ダウンロードができます

ソースコード

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:
    cnt[Si] += 1

for Si in S:
    ans = 0
    
    for i in range(len(Si)):
        for j in range(26):
            if ord(Si[i])-ord('a')==j:
                continue
            
            T = list(Si)
            T[i] = chr(j+ord('a'))
            ans += cnt[''.join(T)]
    
    print(ans)
0