結果

問題 No.1005 BOT対策
ユーザー lemon
提出日時 2021-05-02 17:28:01
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 557 bytes
コンパイル時間 121 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-07-21 02:31:43
合計ジャッジ時間 1,686 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 25 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys, collections
 
sys.setrecursionlimit(500005)
stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().strip()

s = input()
t = input()

ans = s.count(t)

if ans:
    if len(t) == 1:
        ans = -1
    
    else:
        ls = len(s)
        lt = len(t)
        ans = 0
        i = 0
        j = i + lt
        while j <= ls:
            if s[i:j] == t:
                ans += 1
                i = j
            else:
                i += 1

            j = i + lt

print(ans)
0