結果

問題 No.430 文字列検索
ユーザー ldsybldsyb
提出日時 2016-11-11 23:33:32
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 325 bytes
コンパイル時間 463 ms
コンパイル使用メモリ 66,224 KB
実行使用メモリ 6,940 KB
最終ジャッジ日時 2024-05-04 03:13:42
合計ジャッジ時間 16,886 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 273 ms
5,376 KB
testcase_02 AC 1,782 ms
5,376 KB
testcase_03 AC 953 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 1 ms
5,376 KB
testcase_06 AC 1 ms
5,376 KB
testcase_07 AC 1 ms
5,376 KB
testcase_08 AC 3 ms
5,376 KB
testcase_09 AC 1 ms
5,376 KB
testcase_10 AC 2 ms
5,376 KB
testcase_11 AC 1,628 ms
5,376 KB
testcase_12 AC 1,589 ms
5,376 KB
testcase_13 AC 1,616 ms
5,376 KB
testcase_14 TLE -
testcase_15 TLE -
testcase_16 AC 1,808 ms
5,376 KB
testcase_17 AC 1,787 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

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