結果
| 問題 | No.430 文字列検索 | 
| コンテスト | |
| ユーザー |  matsu7874 | 
| 提出日時 | 2016-10-02 23:52:52 | 
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 369 ms / 2,000 ms | 
| コード長 | 270 bytes | 
| コンパイル時間 | 323 ms | 
| コンパイル使用メモリ | 12,672 KB | 
| 実行使用メモリ | 51,896 KB | 
| 最終ジャッジ日時 | 2024-11-10 00:05:19 | 
| 合計ジャッジ時間 | 3,894 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 4 | 
| other | AC * 14 | 
ソースコード
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)
            
            
            
        