結果

問題 No.1005 BOT対策
ユーザー c-yan
提出日時 2020-03-06 23:20:56
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 31 ms / 2,000 ms
コード長 285 bytes
コンパイル時間 127 ms
コンパイル使用メモリ 12,032 KB
実行使用メモリ 10,240 KB
最終ジャッジ日時 2025-06-20 00:49:37
合計ジャッジ時間 1,930 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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
    S = S[:p + len(T) - 1] + '.' + S[p + len(T) - 1:]
    result += 1
print(result)
0