結果

問題 No.430 文字列検索
ユーザー ヒッキープログラミングするスレヒッキープログラミングするスレ
提出日時 2016-10-03 00:39:20
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 246 bytes
コンパイル時間 93 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 11,264 KB
最終ジャッジ日時 2024-05-01 11:08:58
合計ジャッジ時間 3,586 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,752 KB
testcase_01 WA -
testcase_02 AC 230 ms
11,264 KB
testcase_03 AC 238 ms
11,264 KB
testcase_04 AC 30 ms
10,752 KB
testcase_05 AC 30 ms
10,752 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 110 ms
10,880 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 238 ms
11,264 KB
testcase_12 AC 238 ms
11,136 KB
testcase_13 AC 250 ms
11,264 KB
testcase_14 AC 244 ms
11,264 KB
testcase_15 AC 240 ms
11,136 KB
testcase_16 AC 238 ms
11,264 KB
testcase_17 AC 234 ms
11,264 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

s = input()
m = int(input())
h = {}
mx = 0
for _ in range(m):
    c = input()
    h[c] = True
    mx = max(len(c), mx)

ans = 0
for i in range(len(s)):
    for j in range(1, mx + 1):
        if s[i : i + j] in h:
            ans += 1

print(ans)
0