結果

問題 No.1994 Confusing Name
ユーザー roarisroaris
提出日時 2022-10-29 17:13:31
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 512 bytes
コンパイル時間 268 ms
コンパイル使用メモリ 86,976 KB
実行使用メモリ 93,668 KB
最終ジャッジ日時 2023-09-20 20:15:36
合計ジャッジ時間 35,493 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 102 ms
77,636 KB
testcase_01 AC 103 ms
77,592 KB
testcase_02 AC 101 ms
77,296 KB
testcase_03 AC 93 ms
71,680 KB
testcase_04 AC 93 ms
71,388 KB
testcase_05 AC 123 ms
77,648 KB
testcase_06 AC 138 ms
77,840 KB
testcase_07 AC 115 ms
77,876 KB
testcase_08 AC 132 ms
77,664 KB
testcase_09 AC 142 ms
77,900 KB
testcase_10 AC 126 ms
77,956 KB
testcase_11 AC 125 ms
77,796 KB
testcase_12 TLE -
testcase_13 TLE -
testcase_14 TLE -
testcase_15 AC 1,957 ms
89,580 KB
testcase_16 AC 1,765 ms
87,684 KB
testcase_17 AC 1,934 ms
89,116 KB
testcase_18 TLE -
testcase_19 TLE -
testcase_20 TLE -
testcase_21 AC 498 ms
81,360 KB
testcase_22 AC 294 ms
79,440 KB
testcase_23 TLE -
testcase_24 TLE -
testcase_25 AC 1,331 ms
86,720 KB
testcase_26 AC 677 ms
82,472 KB
testcase_27 AC 1,873 ms
91,584 KB
testcase_28 AC 1,456 ms
87,140 KB
testcase_29 AC 271 ms
79,148 KB
testcase_30 AC 1,556 ms
88,512 KB
権限があれば一括ダウンロードができます

ソースコード

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'))
            T = ''.join(T)
            
            if T in cnt:
                ans += cnt[T]
    
    print(ans)
0