結果
| 問題 |
No.430 文字列検索
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-05-11 00:55:05 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 802 bytes |
| コンパイル時間 | 144 ms |
| コンパイル使用メモリ | 82,168 KB |
| 実行使用メモリ | 73,620 KB |
| 最終ジャッジ日時 | 2024-11-10 01:00:28 |
| 合計ジャッジ時間 | 5,783 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 4 |
| other | AC * 1 TLE * 2 -- * 11 |
ソースコード
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)