結果

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

ソースコード

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+T_size-1 < S_size-T_size; ++i) {
        if(S.substr(i,T_size)==T) {
            cnt++;
            i+=T_size-2;
        }
    }

    cout<<cnt<<endl;

    return 0;
}
0