結果

問題 No.1994 Confusing Name
ユーザー とりゐとりゐ
提出日時 2022-07-01 21:29:43
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,126 ms / 2,000 ms
コード長 339 bytes
コンパイル時間 912 ms
コンパイル使用メモリ 82,348 KB
実行使用メモリ 281,576 KB
最終ジャッジ日時 2024-05-04 15:38:15
合計ジャッジ時間 17,483 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
59,920 KB
testcase_01 AC 40 ms
58,508 KB
testcase_02 AC 42 ms
59,236 KB
testcase_03 AC 37 ms
54,516 KB
testcase_04 AC 36 ms
55,584 KB
testcase_05 AC 72 ms
77,648 KB
testcase_06 AC 80 ms
78,476 KB
testcase_07 AC 52 ms
67,912 KB
testcase_08 AC 78 ms
78,264 KB
testcase_09 AC 78 ms
78,664 KB
testcase_10 AC 73 ms
78,244 KB
testcase_11 AC 61 ms
74,208 KB
testcase_12 AC 670 ms
196,752 KB
testcase_13 AC 1,061 ms
276,904 KB
testcase_14 AC 978 ms
277,860 KB
testcase_15 AC 749 ms
244,444 KB
testcase_16 AC 687 ms
217,220 KB
testcase_17 AC 750 ms
234,876 KB
testcase_18 AC 1,126 ms
281,576 KB
testcase_19 AC 1,107 ms
280,568 KB
testcase_20 AC 1,115 ms
281,456 KB
testcase_21 AC 213 ms
108,900 KB
testcase_22 AC 139 ms
91,528 KB
testcase_23 AC 856 ms
239,864 KB
testcase_24 AC 818 ms
231,240 KB
testcase_25 AC 549 ms
171,496 KB
testcase_26 AC 306 ms
122,932 KB
testcase_27 AC 789 ms
217,772 KB
testcase_28 AC 601 ms
185,216 KB
testcase_29 AC 158 ms
90,560 KB
testcase_30 AC 685 ms
195,000 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict
n=int(input())
d=defaultdict(int)
Ss=[]
for i in range(n):
  s=list(input())
  m=len(s)
  for j in range(m):
    t=s.copy()
    t[j]='!'
    t=tuple(t)
    d[t]+=1
  Ss.append(s)

for s in Ss:
  m=len(s)
  ans=-m
  for j in range(m):
    t=s.copy()
    t[j]='!'
    t=tuple(t)
    ans+=d[t]
  print(ans)
0