結果

問題 No.1994 Confusing Name
ユーザー MasKoaTSMasKoaTS
提出日時 2022-06-14 21:30:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 536 ms / 2,000 ms
コード長 972 bytes
コンパイル時間 210 ms
コンパイル使用メモリ 82,392 KB
実行使用メモリ 153,428 KB
最終ジャッジ日時 2024-04-12 10:55:02
合計ジャッジ時間 10,793 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
86,932 KB
testcase_01 AC 119 ms
86,912 KB
testcase_02 AC 119 ms
86,992 KB
testcase_03 AC 118 ms
86,948 KB
testcase_04 AC 118 ms
86,744 KB
testcase_05 AC 146 ms
89,932 KB
testcase_06 AC 154 ms
89,632 KB
testcase_07 AC 136 ms
89,660 KB
testcase_08 AC 155 ms
90,028 KB
testcase_09 AC 157 ms
89,916 KB
testcase_10 AC 142 ms
89,932 KB
testcase_11 AC 141 ms
89,872 KB
testcase_12 AC 412 ms
129,732 KB
testcase_13 AC 482 ms
151,596 KB
testcase_14 AC 500 ms
153,428 KB
testcase_15 AC 443 ms
144,888 KB
testcase_16 AC 395 ms
137,944 KB
testcase_17 AC 428 ms
145,396 KB
testcase_18 AC 536 ms
152,000 KB
testcase_19 AC 530 ms
152,668 KB
testcase_20 AC 526 ms
152,424 KB
testcase_21 AC 221 ms
106,676 KB
testcase_22 AC 180 ms
97,604 KB
testcase_23 AC 470 ms
141,616 KB
testcase_24 AC 453 ms
136,980 KB
testcase_25 AC 348 ms
127,824 KB
testcase_26 AC 255 ms
108,856 KB
testcase_27 AC 440 ms
135,780 KB
testcase_28 AC 368 ms
128,688 KB
testcase_29 AC 185 ms
96,536 KB
testcase_30 AC 376 ms
129,344 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools as iter
import collections as coll
import heapq as hq
import bisect as bis
from decimal import Decimal as dec
from functools import cmp_to_key
import math
import sys
#import pypyjit
#pypyjit.set_param('max_unroll_recursion=-1')
sys.setrecursionlimit(10 ** 6)
inp = sys.stdin.readline
input = lambda : inp().rstrip()
getN = lambda : int(inp())
getNs = lambda : map(int, inp().split())
getList = lambda :list(map(int, inp().split()))
getStrs = lambda n : [input() for _ in [0] * n]
def yexit(): print("Yes"); exit(0)
def nexit(): print("No"); exit(0)
pi = 3.141592653589793
mod = 1000000007
MOD = 998244353
INF = 4611686018427387903
dx = [1, 0, -1, 0];	dy = [0, 1, 0, -1]


"""
Main Code
"""

n = getN()
s = getStrs(n)

d = coll.defaultdict(lambda : -1)
for ss in s:
	for i in range(len(ss)):
		t = ''.join([ss[:i], '?', ss[i+1:]])
		d[t] += 1
for ss in s:
	ans = 0
	for i in range(len(ss)):
		t = ''.join([ss[:i], '?', ss[i+1:]])
		ans += d[t]
	print(ans)
0