結果

問題 No.430 文字列検索
ユーザー kojihashimoto-kobe
提出日時 2021-07-17 14:33:18
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 279 ms / 2,000 ms
コード長 296 bytes
コンパイル時間 178 ms
コンパイル使用メモリ 82,412 KB
実行使用メモリ 170,612 KB
最終ジャッジ日時 2024-11-10 00:57:08
合計ジャッジ時間 3,178 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

S = input()
l = len(S)
#Sから作れる部分文字列を全列挙。
s = []
for i in range(l):
  for j in range(1, 11):
    if i +j <= l:
      s.append(S[i:i+j])

import collections
s = collections.Counter(s)

m = int(input())
ans = 0
for _ in range(m):
  c = input()
  ans += s[c]

print(ans)
0