結果

問題 No.1005 BOT対策
ユーザー a163236
提出日時 2020-03-07 00:54:17
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 484 bytes
コンパイル時間 1,707 ms
コンパイル使用メモリ 168,632 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-14 10:56:40
合計ジャッジ時間 2,494 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 24 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _LIBCPP_DEBUG 0
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
ll MOD = 1e9 + 7;


int main(void) {

    string S,T; cin>>S>>T;

    if(T.size()==1){
        cout<<-1<<endl;
        return 0;
    }

    int S_size = S.size();
    int T_size = T.size();
    int cnt = 0;
    for (int i = 0; i < S_size-T_size+1; ++i) {
        if(S.substr(i,T_size)==T) {
            cnt++;
            i+=T_size-2;
        }
    }

    cout<<cnt<<endl;

    return 0;
}
0