結果

問題 No.1005 BOT対策
ユーザー takakin
提出日時 2020-05-11 23:22:30
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 33 ms / 2,000 ms
コード長 270 bytes
コンパイル時間 236 ms
コンパイル使用メモリ 12,160 KB
実行使用メモリ 10,112 KB
最終ジャッジ日時 2025-06-20 00:52:42
合計ジャッジ時間 2,160 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=lambda: sys.stdin.readline().rstrip()
S=input()
T=input()
ans=0
s,t=len(S),len(T)
if t==1:
  if S.count(T)>0:
    print(-1)
  else:
    print(0)
else:
  l=0
  while l+t<=s:
    if S[l:l+t]==T:
      ans+=1
      l=l+t-1
    else:
      l+=1
  print(ans)
0