結果
問題 | No.1005 BOT対策 |
ユーザー |
![]() |
提出日時 | 2021-02-03 02:03:09 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 381 bytes |
コンパイル時間 | 149 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 17,440 KB |
最終ジャッジ日時 | 2024-06-30 00:05:37 |
合計ジャッジ時間 | 3,760 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 1 TLE * 1 -- * 25 |
ソースコード
s = input()t = input()"""sに連続列としてtが含まれないようにしたい何個.が必要?tの数を純粋に数えるとs=aaaaaaa,t=aaaみたいな時に辛い。尺取みたいにする"""idx = 0ans = 0lt, ls = len(t), len(s)while idx + lt <= ls:if s[idx : idx + lt] == t:ans += 1idx += lt - 1else:idx += 1print(ans)