結果
問題 |
No.430 文字列検索
|
ユーザー |
|
提出日時 | 2022-05-11 00:54:49 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 802 bytes |
コンパイル時間 | 81 ms |
コンパイル使用メモリ | 12,800 KB |
実行使用メモリ | 17,828 KB |
最終ジャッジ日時 | 2024-11-10 01:00:23 |
合計ジャッジ時間 | 3,471 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 4 |
other | AC * 1 TLE * 1 -- * 12 |
ソースコード
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)