結果

問題 No.430 文字列検索
ユーザー matsu7874matsu7874
提出日時 2016-10-02 23:52:52
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 372 ms / 2,000 ms
コード長 270 bytes
コンパイル時間 453 ms
コンパイル使用メモリ 10,628 KB
実行使用メモリ 52,812 KB
最終ジャッジ日時 2023-08-15 17:29:34
合計ジャッジ時間 4,892 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
8,552 KB
testcase_01 AC 371 ms
52,812 KB
testcase_02 AC 221 ms
9,116 KB
testcase_03 AC 224 ms
9,032 KB
testcase_04 AC 18 ms
8,408 KB
testcase_05 AC 18 ms
8,544 KB
testcase_06 AC 18 ms
8,400 KB
testcase_07 AC 18 ms
8,552 KB
testcase_08 AC 372 ms
52,672 KB
testcase_09 AC 18 ms
8,572 KB
testcase_10 AC 46 ms
11,552 KB
testcase_11 AC 248 ms
14,240 KB
testcase_12 AC 258 ms
14,212 KB
testcase_13 AC 250 ms
14,272 KB
testcase_14 AC 235 ms
12,200 KB
testcase_15 AC 242 ms
11,504 KB
testcase_16 AC 225 ms
9,248 KB
testcase_17 AC 225 ms
8,952 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections
text = input()
len_text = len(text)
dic = collections.defaultdict(int)
for i in range(1,11):
    for j in range(len_text-i+1):
        dic[text[j:j+i]] += 1
total = 0
m = int(input())
for i in range(m):
    c = input()
    total += dic[c]
print(total)
0