結果

問題 No.1005 BOT対策
ユーザー c-yan
提出日時 2020-03-06 23:26:35
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 32 ms / 2,000 ms
コード長 251 bytes
コンパイル時間 122 ms
コンパイル使用メモリ 12,032 KB
実行使用メモリ 10,240 KB
最終ジャッジ日時 2025-06-20 00:49:43
合計ジャッジ時間 2,064 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

S = input()
T = input()

if len(T) == 1:
    if S.find(T) == -1:
        print(0)
    else:
        print(-1)
    exit()

result = 0
p = 0
while True:
    p = S.find(T, p)
    if p == -1:
        break
    p += len(T) - 1
    result += 1
print(result)
0