結果
| 問題 | No.430 文字列検索 | 
| コンテスト | |
| ユーザー |  kurenai3110 | 
| 提出日時 | 2016-10-02 23:02:01 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 883 ms / 2,000 ms | 
| コード長 | 438 bytes | 
| コンパイル時間 | 456 ms | 
| コンパイル使用メモリ | 64,772 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-11-10 00:03:13 | 
| 合計ジャッジ時間 | 10,034 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 4 | 
| other | AC * 14 | 
ソースコード
#include <iostream>
#include <string>
#include <iomanip>
#include <vector>
using namespace std;
int main()
{
	string s;
	cin >> s;
	int m; cin >> m;
	int ans = 0;
	for (int i = 0; i < m; i++) {
		string target; cin >> target;
		int index = s.size();
		while (index != -1) {
			index = s.rfind(target, index);
			//cout << index << endl;
			if (index != -1)ans++;
			else break;
			index--;
		}
	}
	cout << ans << endl;
    return 0;
}
            
            
            
        