結果

問題 No.1994 Confusing Name
ユーザー lilictakalilictaka
提出日時 2022-07-01 22:30:53
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 974 ms / 2,000 ms
コード長 467 bytes
コンパイル時間 399 ms
コンパイル使用メモリ 87,320 KB
実行使用メモリ 259,288 KB
最終ジャッジ日時 2023-08-17 09:59:44
合計ジャッジ時間 15,760 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 88 ms
71,316 KB
testcase_01 AC 88 ms
71,820 KB
testcase_02 AC 87 ms
71,644 KB
testcase_03 AC 87 ms
71,592 KB
testcase_04 AC 89 ms
71,712 KB
testcase_05 AC 117 ms
78,096 KB
testcase_06 AC 136 ms
79,620 KB
testcase_07 AC 114 ms
78,004 KB
testcase_08 AC 134 ms
79,564 KB
testcase_09 AC 142 ms
79,724 KB
testcase_10 AC 125 ms
78,168 KB
testcase_11 AC 122 ms
77,808 KB
testcase_12 AC 723 ms
197,528 KB
testcase_13 AC 888 ms
247,920 KB
testcase_14 AC 897 ms
250,312 KB
testcase_15 AC 754 ms
214,892 KB
testcase_16 AC 673 ms
198,660 KB
testcase_17 AC 751 ms
214,628 KB
testcase_18 AC 969 ms
253,572 KB
testcase_19 AC 974 ms
254,908 KB
testcase_20 AC 971 ms
259,288 KB
testcase_21 AC 261 ms
104,656 KB
testcase_22 AC 188 ms
88,964 KB
testcase_23 AC 864 ms
224,036 KB
testcase_24 AC 760 ms
218,688 KB
testcase_25 AC 543 ms
165,048 KB
testcase_26 AC 313 ms
116,644 KB
testcase_27 AC 736 ms
207,460 KB
testcase_28 AC 591 ms
172,924 KB
testcase_29 AC 178 ms
85,564 KB
testcase_30 AC 608 ms
179,708 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict
N = int(input())
cnt = [defaultdict(int) for _ in range(10)]
def f(l,S):
    rev = []
    for i in range(len(S)):
        if i == l:
            continue
        rev.append(S[i])
    return ''.join(rev)
board = []     
for i in range(N):
    S = list(input())
    for l in range(len(S)):
        cnt[l][f(l,S)] += 1
        board.append((i,l,f(l,S)))
ANS = [0] * N
for i,l,s in board:
    ANS[i] += cnt[l][s]-1
print(*ANS,sep='\n')
0