結果

問題 No.430 文字列検索
ユーザー kojihashimoto-kobekojihashimoto-kobe
提出日時 2021-07-17 14:33:18
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 391 ms / 2,000 ms
コード長 296 bytes
コンパイル時間 997 ms
コンパイル使用メモリ 86,884 KB
実行使用メモリ 191,436 KB
最終ジャッジ日時 2023-09-21 07:55:11
合計ジャッジ時間 5,710 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 94 ms
71,716 KB
testcase_01 AC 391 ms
191,296 KB
testcase_02 AC 213 ms
111,284 KB
testcase_03 AC 214 ms
111,424 KB
testcase_04 AC 95 ms
71,424 KB
testcase_05 AC 92 ms
71,488 KB
testcase_06 AC 94 ms
71,720 KB
testcase_07 AC 95 ms
71,476 KB
testcase_08 AC 367 ms
191,436 KB
testcase_09 AC 97 ms
71,580 KB
testcase_10 AC 120 ms
87,204 KB
testcase_11 AC 274 ms
118,220 KB
testcase_12 AC 273 ms
118,044 KB
testcase_13 AC 275 ms
118,172 KB
testcase_14 AC 256 ms
111,528 KB
testcase_15 AC 240 ms
111,408 KB
testcase_16 AC 219 ms
111,396 KB
testcase_17 AC 215 ms
111,436 KB
権限があれば一括ダウンロードができます

ソースコード

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