結果

問題 No.1005 BOT対策
ユーザー miya145592
提出日時 2023-05-19 01:26:56
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 40 ms / 2,000 ms
コード長 362 bytes
コンパイル時間 368 ms
コンパイル使用メモリ 82,400 KB
実行使用メモリ 59,920 KB
最終ジャッジ日時 2025-06-20 01:42:28
合計ジャッジ時間 2,445 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

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