結果

問題 No.1005 BOT対策
ユーザー stngstng
提出日時 2022-08-18 10:56:20
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 36 ms / 2,000 ms
コード長 260 bytes
コンパイル時間 194 ms
コンパイル使用メモリ 82,504 KB
実行使用メモリ 54,296 KB
最終ジャッジ日時 2025-01-01 20:14:23
合計ジャッジ時間 2,085 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

s = input()
t = input()
num = s.count(t)
if len(t) == 1 and num > 0:
    print(-1)
    exit()

tidx = 0
sidx = 0
ans = 0
for i in range(len(s)):
    if s[sidx:sidx+len(t)] == t:
        ans += 1
        sidx += len(t)-1
    else:
        sidx += 1

print(ans)
0