結果

問題 No.1994 Confusing Name
ユーザー roarisroaris
提出日時 2022-10-29 17:11:39
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 452 bytes
コンパイル時間 327 ms
コンパイル使用メモリ 86,928 KB
実行使用メモリ 102,692 KB
最終ジャッジ日時 2023-09-20 20:13:48
合計ジャッジ時間 9,380 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 105 ms
77,880 KB
testcase_01 AC 109 ms
77,380 KB
testcase_02 AC 103 ms
77,368 KB
testcase_03 AC 101 ms
71,704 KB
testcase_04 AC 93 ms
71,548 KB
testcase_05 AC 148 ms
89,724 KB
testcase_06 AC 212 ms
98,108 KB
testcase_07 AC 129 ms
84,292 KB
testcase_08 AC 173 ms
93,808 KB
testcase_09 AC 222 ms
102,692 KB
testcase_10 AC 163 ms
92,036 KB
testcase_11 AC 149 ms
88,888 KB
testcase_12 TLE -
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