結果

問題 No.430 文字列検索
ユーザー ldsyb
提出日時 2016-11-11 23:33:32
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 325 bytes
コンパイル時間 530 ms
コンパイル使用メモリ 64,384 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-10 00:13:02
合計ジャッジ時間 17,976 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 12 TLE * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;

int main(){
	string s, c;
	int m, count = 0;
	cin >> s >> m;
	while(m--){
		cin >> c;
		for(int i = 0; i + c.size() - 1 < s.size(); i++) if(s[i] == c[0]){
			bool f = true;
			for(int j = 1; j < c.size(); j++) f &= s[i + j] == c[j];
			if(f) count++;
		}
	}
	cout << count << endl;
}
0