結果

問題 No.1005 BOT対策
コンテスト
ユーザー miya145592
提出日時 2023-05-19 01:26:56
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 58 ms / 2,000 ms
+ 434µs
コード長 362 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 221 ms
コンパイル使用メモリ 96,232 KB
実行使用メモリ 83,144 KB
最終ジャッジ日時 2026-07-12 09:18:14
合計ジャッジ時間 3,540 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

S = input()
T = input()
if len(T)==1:
    if S.count(T)==0:
        print(0)
    else:
        print(-1)
    exit()
i = 0
j = 0
cnt = 0
while i<len(S):
    if S[i]!=T[j]:
        if j==0:
            i+=1
        else:
            j=0
    else:
        if j==len(T)-1:
            cnt+=1
            j=0
        else:
            i+=1
            j+=1
print(cnt)
0