結果

問題 No.1005 BOT対策
ユーザー hamap000hamap000
提出日時 2020-03-16 13:58:41
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 607 bytes
コンパイル時間 1,630 ms
コンパイル使用メモリ 166,416 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-28 02:48:34
合計ジャッジ時間 2,585 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 25 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;
typedef pair<int,int> P;
int main()
{
    string S, T;
    cin >> S >> T;
    int num = 0;
    rep(i,S.size()-T.size()+1){
        bool l = false;
        for (int j = 0; j < T.size();j++){
            if(S.at(i+j)!=T.at(j)){
                l = true;
            }
        }
        if(!l){
            if(T.size()==1){
                cout << -1 << endl;
                return 0;
            }
            num++;
            i += T.size()-1;
        }
    }
    cout << num << endl;
}
0