結果
| 問題 | No.430 文字列検索 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-09-22 06:35:20 |
| 言語 | Python3 (3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL) |
| 結果 |
TLE
不安定
|
| 実行時間 | - |
| コード長 | 439 bytes |
| 記録 | |
| コンパイル時間 | 56 ms |
| コンパイル使用メモリ | 14,976 KB |
| 実行使用メモリ | 13,432 KB |
| 最終ジャッジ日時 | 2026-09-21 16:42:00 |
| 合計ジャッジ時間 | 7,325 ms |
|
ジャッジサーバーID (参考情報) |
judge5_1 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 4 |
| other | AC * 2 TLE * 1 -- * 11 |
ソースコード
from collections import defaultdict
from sys import stdin
input = lambda: stdin.readline().rstrip()
def main():
S = input()
M = int(input())
C = stdin.read().splitlines()
strings = defaultdict(list)
for i, s in enumerate(S):
strings[s].append(i)
ans = 0
for ci in C:
l = len(ci)
for i in strings[ci[0]]:
if S[i:i+l] == ci:
ans += 1
print(ans)
main()