結果

問題 No.430 文字列検索
ユーザー yudai1102jpyudai1102jp
提出日時 2022-05-11 00:54:49
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 802 bytes
コンパイル時間 190 ms
コンパイル使用メモリ 10,824 KB
実行使用メモリ 8,832 KB
最終ジャッジ日時 2023-09-25 09:31:19
合計ジャッジ時間 4,000 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 20 ms
8,832 KB
testcase_01 TLE -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
import sys
import heapq
from collections import deque
sys.setrecursionlimit(500*500)

stdin = sys.stdin


def YES(): print('Yes')
def NO(): print('No')
def TAKAHASHI(): print('Takahashi')
def AOKI(): print("Aoki")
def ns(): return stdin.readline().strip()
def ni(): return int(ns())
def na(): return list(map(int, stdin.readline().split()))
def nz(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def nm(n): return [na() for _ in range(n)]


MOD = int(1e9+7)


def YES():
    print('Yes')


def NO():
    print('No')


def TAKAHASHI():
    print('Takahashi')


def AOKI():
    print("Aoki")


s = ns()
M = ni()
s_set = [set()]*11

ans = 0
for i in range(M):
    c = ns()
    lc = len(c)
    for j in range(len(s)-lc+1):
        ans += 1 if c == s[j:j+lc] else 0
print(ans)
0