結果
| 問題 | No.430 文字列検索 | 
| コンテスト | |
| ユーザー |  ふーらくたる | 
| 提出日時 | 2016-10-02 23:49:37 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 1,997 ms / 2,000 ms | 
| コード長 | 506 bytes | 
| コンパイル時間 | 431 ms | 
| コンパイル使用メモリ | 60,116 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-11-10 00:05:15 | 
| 合計ジャッジ時間 | 12,591 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 4 | 
| other | AC * 14 | 
ソースコード
#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++;
            res = s.find(c, res + 1);
        }
    }
    cout << ans << endl;
    return 0;
}
            
            
            
        