結果

問題 No.1005 BOT対策
ユーザー futago0118
提出日時 2020-07-10 21:00:13
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 33 ms / 2,000 ms
コード長 274 bytes
コンパイル時間 120 ms
コンパイル使用メモリ 11,904 KB
実行使用メモリ 10,240 KB
最終ジャッジ日時 2025-06-20 00:53:28
合計ジャッジ時間 2,084 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

S = input()
BOT = input()


if len(BOT) == 1 and S.count(BOT) != 0:
    print("-1")
elif len(BOT) == 2 and BOT[0]==BOT[1]:
    cnt = 0
    for i in range(len(S)-len(BOT)+1):
        if S[i:i+len(BOT)] == BOT:
            cnt += 1
    print(cnt)
else:
    print(S.count(BOT))
0