結果

問題 No.1005 BOT対策
コンテスト
ユーザー knk_kei
提出日時 2021-02-03 02:04:38
言語 Python3
(3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
WA  
実行時間 -
コード長 375 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 300 ms
コンパイル使用メモリ 21,668 KB
実行使用メモリ 15,996 KB
最終ジャッジ日時 2026-08-02 02:02:27
合計ジャッジ時間 5,027 ms
ジャッジサーバーID
(参考情報)
judge1_1 / judge3_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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