結果

問題 No.430 文字列検索
ユーザー Poina15Poina15
提出日時 2018-09-05 14:41:18
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 620 ms / 2,000 ms
コード長 266 bytes
コンパイル時間 101 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 52,164 KB
最終ジャッジ日時 2024-04-26 17:17:01
合計ジャッジ時間 6,294 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,880 KB
testcase_01 AC 620 ms
52,164 KB
testcase_02 AC 437 ms
10,752 KB
testcase_03 AC 419 ms
10,880 KB
testcase_04 AC 28 ms
10,624 KB
testcase_05 AC 29 ms
10,496 KB
testcase_06 AC 28 ms
10,752 KB
testcase_07 AC 29 ms
10,880 KB
testcase_08 AC 599 ms
52,136 KB
testcase_09 AC 30 ms
10,624 KB
testcase_10 AC 75 ms
13,612 KB
testcase_11 AC 461 ms
16,492 KB
testcase_12 AC 468 ms
16,496 KB
testcase_13 AC 473 ms
16,488 KB
testcase_14 AC 452 ms
13,936 KB
testcase_15 AC 432 ms
12,596 KB
testcase_16 AC 418 ms
11,008 KB
testcase_17 AC 429 ms
10,880 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter
S = input()
M = int(input())
ls = len(S)
counter = Counter()
for i in range(ls):
    for j in range(1, 11):
        if i + j <= ls:
            counter[S[i:i + j]] += 1
ans = 0
for _ in range(M):
    ans += counter[input()]
print(ans)
0