結果

問題 No.1005 BOT対策
コンテスト
ユーザー knk_kei
提出日時 2021-02-03 02:04:38
言語 Python3
(3.14.3 + numpy 2.4.2 + scipy 1.17.0)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
WA  
実行時間 -
コード長 375 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 416 ms
コンパイル使用メモリ 20,828 KB
実行使用メモリ 15,488 KB
最終ジャッジ日時 2026-03-19 15:46:51
合計ジャッジ時間 4,436 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 23 WA * 6
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

s = input()
t = input()
"""
sに連続列としてtが含まれないようにしたい
何個.が必要?
tの数を純粋に数えるとs=aaaaaaa,t=aaaみたいな時に辛い。
尺取みたいにする
"""
idx = 0
ans = 0
lt, ls = len(t), len(s)
while idx + lt <= ls:
    if s[idx : idx + lt] == t:
        ans += 1
        idx += max(lt - 2, 0)
    idx += 1
print(ans)
0