結果
| 問題 | No.430 文字列検索 | 
| コンテスト | |
| ユーザー |  ふーらくたる | 
| 提出日時 | 2016-10-02 23:43:51 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 536 bytes | 
| コンパイル時間 | 605 ms | 
| コンパイル使用メモリ | 59,996 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-11-10 00:04:50 | 
| 合計ジャッジ時間 | 12,761 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 WA * 2 | 
| other | AC * 5 WA * 9 | 
ソースコード
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
using ll = long long;
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    string s;
    cin >> s;
    int m;
    cin >> m;
    ll ans = 0;
    for (int i = 0; i < m; i++) {
        string c;
        cin >> c;
        int pos = 0;
        auto res = s.find(c, pos);
        while (res != -1) {
            ans++;
            pos = res + c.size();
            res = s.find(c, pos);
        }
    }
    cout << ans << endl;
    return 0;
}
            
            
            
        