結果
問題 |
No.430 文字列検索
|
ユーザー |
![]() |
提出日時 | 2016-10-02 22:58:20 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 325 bytes |
コンパイル時間 | 200 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 120,344 KB |
最終ジャッジ日時 | 2024-11-10 00:02:48 |
合計ジャッジ時間 | 3,654 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 4 |
other | AC * 1 TLE * 1 -- * 12 |
ソースコード
#!/usr/bin/env pypy3 import re def count_all(s, substr): ptn = re.compile("(?={})".format(substr)) return sum(1 for m in re.finditer(ptn, s)) def main(): s = input() m = int(input()) cs = [input() for _ in range(m)] print(sum(count_all(s, c) for c in cs)) if __name__ == '__main__': main()