結果

問題 No.430 文字列検索
ユーザー vwxyzvwxyz
提出日時 2023-08-10 09:55:06
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 226 ms / 2,000 ms
コード長 300 bytes
コンパイル時間 195 ms
コンパイル使用メモリ 81,920 KB
実行使用メモリ 164,116 KB
最終ジャッジ日時 2024-04-28 03:20:48
合計ジャッジ時間 2,660 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,376 KB
testcase_01 AC 226 ms
164,116 KB
testcase_02 AC 86 ms
76,204 KB
testcase_03 AC 88 ms
76,404 KB
testcase_04 AC 37 ms
53,248 KB
testcase_05 AC 36 ms
53,248 KB
testcase_06 AC 37 ms
53,248 KB
testcase_07 AC 37 ms
53,888 KB
testcase_08 AC 212 ms
163,968 KB
testcase_09 AC 37 ms
53,540 KB
testcase_10 AC 55 ms
74,624 KB
testcase_11 AC 117 ms
88,900 KB
testcase_12 AC 113 ms
89,168 KB
testcase_13 AC 116 ms
88,784 KB
testcase_14 AC 107 ms
83,200 KB
testcase_15 AC 103 ms
80,384 KB
testcase_16 AC 88 ms
76,332 KB
testcase_17 AC 90 ms
75,904 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
readline=sys.stdin.readline
from collections import defaultdict

S=readline().rstrip()
N=len(S)
cnt=defaultdict(int)
for le in range(1,11):
    for i in range(N-le+1):
        cnt[S[i:i+le]]+=1
M=int(readline())
ans=0
for m in range(M):
    C=readline().rstrip()
    ans+=cnt[C]
print(ans)
0