結果

問題 No.1005 BOT対策
ユーザー rniya
提出日時 2020-03-06 21:38:24
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 361 bytes
コンパイル時間 1,402 ms
コンパイル使用メモリ 165,772 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-10-14 10:28:45
合計ジャッジ時間 2,209 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 15 WA * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    string S,T; cin >> S >> T;
    int n=S.size(),m=T.size(),cnt=0,ans=0;
    for (int i=0;i<n;++i){
        if (S[i]==T[cnt]){
            if (cnt==m-1) ++ans,cnt=0;
            else ++cnt;
        }
        else cnt=0;
    }
    cout << ans << '\n';
}
0