結果
| 問題 |
No.430 文字列検索
|
| コンテスト | |
| ユーザー |
💕💖💞
|
| 提出日時 | 2017-01-28 18:43:18 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 301 ms / 2,000 ms |
| コード長 | 301 bytes |
| コンパイル時間 | 241 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 11,776 KB |
| 最終ジャッジ日時 | 2024-11-10 00:14:06 |
| 合計ジャッジ時間 | 4,330 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 14 |
ソースコード
s = input()
m = int(input())
search = set()
[search.add(input()) for _ in range(m)]
maxlen = max(map(lambda x:len(x), search))
result = 0
for start in range(len(s)):
for width in range(1, min(len(s) - start, maxlen) + 1):
result += 1 if s[start:start+width] in search else 0
print(result)
💕💖💞