結果

問題 No.1994 Confusing Name
ユーザー rlangevinrlangevin
提出日時 2023-01-19 00:32:12
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 680 ms / 2,000 ms
コード長 411 bytes
コンパイル時間 506 ms
コンパイル使用メモリ 87,308 KB
実行使用メモリ 162,612 KB
最終ジャッジ日時 2023-09-02 17:38:06
合計ジャッジ時間 14,402 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 95 ms
71,632 KB
testcase_01 AC 88 ms
71,472 KB
testcase_02 AC 88 ms
71,648 KB
testcase_03 AC 89 ms
71,908 KB
testcase_04 AC 88 ms
71,772 KB
testcase_05 AC 118 ms
78,204 KB
testcase_06 AC 135 ms
78,864 KB
testcase_07 AC 107 ms
77,680 KB
testcase_08 AC 129 ms
77,744 KB
testcase_09 AC 134 ms
78,740 KB
testcase_10 AC 126 ms
78,704 KB
testcase_11 AC 118 ms
78,132 KB
testcase_12 AC 525 ms
134,792 KB
testcase_13 AC 624 ms
157,992 KB
testcase_14 AC 637 ms
160,224 KB
testcase_15 AC 554 ms
150,268 KB
testcase_16 AC 470 ms
140,760 KB
testcase_17 AC 522 ms
150,384 KB
testcase_18 AC 651 ms
161,580 KB
testcase_19 AC 680 ms
161,924 KB
testcase_20 AC 674 ms
162,612 KB
testcase_21 AC 226 ms
96,052 KB
testcase_22 AC 170 ms
88,372 KB
testcase_23 AC 583 ms
146,832 KB
testcase_24 AC 582 ms
140,944 KB
testcase_25 AC 392 ms
122,828 KB
testcase_26 AC 260 ms
103,128 KB
testcase_27 AC 536 ms
141,868 KB
testcase_28 AC 435 ms
124,652 KB
testcase_29 AC 165 ms
87,340 KB
testcase_30 AC 469 ms
131,960 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
readline = sys.stdin.readline
from collections import *


N = int(readline())
S = [None] * N
D = defaultdict(int)
for i in range(N):
    S[i] = readline().rstrip()
    for j in range(len(S[i])):
        a, b = S[i][:j], S[i][j + 1:]
        D[(a, b)] += 1

for i in range(N):
    ans = 0
    for j in range(len(S[i])):
        a, b = S[i][:j], S[i][j + 1:]
        ans += D[(a, b)] - 1
    print(ans)
0