結果

問題 No.430 文字列検索
ユーザー H3PO4H3PO4
提出日時 2020-08-03 11:37:52
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 357 ms / 2,000 ms
コード長 234 bytes
コンパイル時間 111 ms
コンパイル使用メモリ 10,636 KB
実行使用メモリ 52,944 KB
最終ジャッジ日時 2023-09-29 13:21:55
合計ジャッジ時間 4,413 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 20 ms
8,540 KB
testcase_01 AC 357 ms
52,944 KB
testcase_02 AC 223 ms
9,040 KB
testcase_03 AC 225 ms
8,980 KB
testcase_04 AC 19 ms
8,492 KB
testcase_05 AC 19 ms
8,408 KB
testcase_06 AC 18 ms
8,488 KB
testcase_07 AC 18 ms
8,488 KB
testcase_08 AC 345 ms
52,700 KB
testcase_09 AC 18 ms
8,508 KB
testcase_10 AC 44 ms
11,544 KB
testcase_11 AC 253 ms
14,184 KB
testcase_12 AC 241 ms
14,184 KB
testcase_13 AC 252 ms
14,320 KB
testcase_14 AC 238 ms
11,988 KB
testcase_15 AC 239 ms
11,404 KB
testcase_16 AC 226 ms
9,380 KB
testcase_17 AC 221 ms
8,868 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict

S = input()
d = defaultdict(int)
for i in range(1, 11):
    for j in range(len(S) - i + 1):
        d[S[j:j + i]] += 1

ans = 0
M = int(input())
for _ in range(M):
    ans += d[input()]
print(ans)
0