結果

問題 No.430 文字列検索
ユーザー matsu7874matsu7874
提出日時 2016-10-02 23:54:14
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 341 ms / 2,000 ms
コード長 270 bytes
コンパイル時間 179 ms
コンパイル使用メモリ 82,084 KB
実行使用メモリ 164,168 KB
最終ジャッジ日時 2024-05-03 04:26:27
合計ジャッジ時間 3,174 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 50 ms
55,412 KB
testcase_01 AC 341 ms
164,100 KB
testcase_02 AC 115 ms
76,344 KB
testcase_03 AC 115 ms
76,268 KB
testcase_04 AC 42 ms
54,052 KB
testcase_05 AC 42 ms
54,640 KB
testcase_06 AC 41 ms
54,348 KB
testcase_07 AC 42 ms
55,172 KB
testcase_08 AC 252 ms
164,168 KB
testcase_09 AC 44 ms
55,316 KB
testcase_10 AC 65 ms
74,940 KB
testcase_11 AC 151 ms
89,544 KB
testcase_12 AC 154 ms
89,036 KB
testcase_13 AC 153 ms
89,552 KB
testcase_14 AC 136 ms
83,780 KB
testcase_15 AC 129 ms
80,968 KB
testcase_16 AC 121 ms
76,848 KB
testcase_17 AC 114 ms
76,696 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