結果
| 問題 | No.430 文字列検索 |
| コンテスト | |
| ユーザー |
ebicochineal
|
| 提出日時 | 2016-10-22 00:50:48 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 894 ms / 2,000 ms |
| コード長 | 346 bytes |
| 記録 | |
| コンパイル時間 | 179 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 10,880 KB |
| 最終ジャッジ日時 | 2024-11-10 00:11:18 |
| 合計ジャッジ時間 | 7,484 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 14 |
ソースコード
#! /usr/bin/env python3
def f(s, t):
p = 0
cnt = 0
while 1:
p = s.find(t)
if p >= 0:
cnt += 1
s = s[p+1:]
else:
break
return cnt
def main():
s = input()
n = int(input())
print(sum(f(s, input()) for _ in range(n)))
if __name__ == '__main__':
main()
ebicochineal