結果
| 問題 | No.430 文字列検索 |
| コンテスト | |
| ユーザー |
vwxyz
|
| 提出日時 | 2023-08-10 09:55:06 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 173 ms / 2,000 ms |
| コード長 | 300 bytes |
| 記録 | |
| コンパイル時間 | 253 ms |
| コンパイル使用メモリ | 85,376 KB |
| 実行使用メモリ | 187,932 KB |
| 最終ジャッジ日時 | 2026-05-09 12:18:36 |
| 合計ジャッジ時間 | 2,548 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 14 |
ソースコード
import sys
readline=sys.stdin.readline
from collections import defaultdict
S=readline().rstrip()
N=len(S)
cnt=defaultdict(int)
for le in range(1,11):
for i in range(N-le+1):
cnt[S[i:i+le]]+=1
M=int(readline())
ans=0
for m in range(M):
C=readline().rstrip()
ans+=cnt[C]
print(ans)
vwxyz