結果

問題 No.430 文字列検索
ユーザー ntudantuda
提出日時 2024-02-13 21:17:24
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 260 ms / 2,000 ms
コード長 249 bytes
コンパイル時間 365 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 163,936 KB
最終ジャッジ日時 2024-02-13 21:17:28
合計ジャッジ時間 3,666 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
53,332 KB
testcase_01 AC 260 ms
163,932 KB
testcase_02 AC 113 ms
76,092 KB
testcase_03 AC 114 ms
76,092 KB
testcase_04 AC 40 ms
53,332 KB
testcase_05 AC 40 ms
53,332 KB
testcase_06 AC 40 ms
53,332 KB
testcase_07 AC 41 ms
55,484 KB
testcase_08 AC 250 ms
163,936 KB
testcase_09 AC 43 ms
55,484 KB
testcase_10 AC 62 ms
75,812 KB
testcase_11 AC 146 ms
89,012 KB
testcase_12 AC 146 ms
89,016 KB
testcase_13 AC 146 ms
89,016 KB
testcase_14 AC 135 ms
83,388 KB
testcase_15 AC 131 ms
80,572 KB
testcase_16 AC 116 ms
76,348 KB
testcase_17 AC 116 ms
76,220 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

S = input()
N = len(S)
from collections import defaultdict

dic = defaultdict(int)
for i in range(1, 11):
    for j in range(N + 1 - i):
        dic[S[j:j + i]] += 1
ans = 0
for _ in range(int(input())):
    C = input()
    ans += dic[C]
print(ans)
0