結果

問題 No.1994 Confusing Name
ユーザー ygd.ygd.
提出日時 2022-07-01 21:58:29
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,038 ms / 2,000 ms
コード長 1,060 bytes
コンパイル時間 245 ms
コンパイル使用メモリ 87,244 KB
実行使用メモリ 85,848 KB
最終ジャッジ日時 2023-08-17 09:32:36
合計ジャッジ時間 16,497 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
76,328 KB
testcase_01 AC 72 ms
76,648 KB
testcase_02 AC 72 ms
76,204 KB
testcase_03 AC 66 ms
71,424 KB
testcase_04 AC 69 ms
71,412 KB
testcase_05 AC 90 ms
76,608 KB
testcase_06 AC 106 ms
77,204 KB
testcase_07 AC 82 ms
76,516 KB
testcase_08 AC 98 ms
76,872 KB
testcase_09 AC 106 ms
77,040 KB
testcase_10 AC 96 ms
77,136 KB
testcase_11 AC 92 ms
77,048 KB
testcase_12 AC 804 ms
85,284 KB
testcase_13 AC 1,038 ms
85,772 KB
testcase_14 AC 936 ms
85,724 KB
testcase_15 AC 914 ms
83,164 KB
testcase_16 AC 780 ms
81,984 KB
testcase_17 AC 925 ms
82,664 KB
testcase_18 AC 1,001 ms
85,400 KB
testcase_19 AC 990 ms
85,528 KB
testcase_20 AC 970 ms
85,844 KB
testcase_21 AC 257 ms
78,888 KB
testcase_22 AC 186 ms
77,824 KB
testcase_23 AC 874 ms
84,876 KB
testcase_24 AC 848 ms
85,848 KB
testcase_25 AC 640 ms
81,504 KB
testcase_26 AC 333 ms
78,944 KB
testcase_27 AC 767 ms
85,284 KB
testcase_28 AC 665 ms
81,860 KB
testcase_29 AC 170 ms
77,844 KB
testcase_30 AC 763 ms
83,172 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
#input = sys.stdin.readline
#input = sys.stdin.buffer.readline #文字列はダメ
#sys.setrecursionlimit(1000000)
#import bisect
#import itertools
#import random
#from heapq import heapify, heappop, heappush
#from collections import defaultdict 
#from collections import deque
#import copy
#import math
#from functools import lru_cache
#@lru_cache(maxsize=None)
#MOD = pow(10,9) + 7
#MOD = 998244353
#dx = [1,0,-1,0]
#dy = [0,1,0,-1]
#dx8 = [1,1,0,-1,-1,-1,0,1]
#dy8 = [0,1,1,1,0,-1,-1,-1]

def main():
    N = int(input())
    S = set([])
    for i in range(N):
        S.add(str(input()))

    ans = []
    for s in S:
        temp = 0
        for i in range(len(s)):
            for j in range(26):
                if s[i] == chr(j+97): continue
                ns = s[:i] + chr(j+97) + s[i+1:]
                # print(ns)
                if ns in S:
                    # print(s,ns,i,j,chr(j+97))
                    temp += 1
        # print("temp",temp)
        ans.append(temp)
    print(*ans,sep="\n")
if __name__ == '__main__':
    main()
0