結果

問題 No.1005 BOT対策
ユーザー 0Kate
提出日時 2020-04-12 01:25:04
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 437 bytes
コンパイル時間 657 ms
コンパイル使用メモリ 66,828 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-09-19 19:46:48
合計ジャッジ時間 1,664 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 19 WA * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <algorithm>
#include <iostream>
#include <string>

using namespace std;

int count_string(string s, string target) {
    int count = 0;
    int pos = 0;
    while ((pos = s.find(target, pos)) != string::npos) {
        count++;
        pos += target.length();
    }

    return count;
}

int main() {
    string s, t;
    cin >> s;
    cin >> t;

    int count = count_string(s, t); 
    cout << count << endl;

    return 0;
}
0