結果

問題 No.430 文字列検索
ユーザー confconf
提出日時 2016-10-02 22:57:14
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 91 ms / 2,000 ms
コード長 444 bytes
コンパイル時間 440 ms
コンパイル使用メモリ 62,756 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-15 17:22:49
合計ジャッジ時間 1,857 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 91 ms
4,380 KB
testcase_02 AC 46 ms
4,380 KB
testcase_03 AC 58 ms
4,376 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 1 ms
4,384 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 29 ms
4,380 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 5 ms
4,380 KB
testcase_11 AC 77 ms
4,380 KB
testcase_12 AC 78 ms
4,376 KB
testcase_13 AC 76 ms
4,380 KB
testcase_14 AC 57 ms
4,380 KB
testcase_15 AC 50 ms
4,380 KB
testcase_16 AC 48 ms
4,376 KB
testcase_17 AC 42 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <set>
using namespace std;

int main(){
    string S;
    int M;
    cin>>S;
    cin>>M;
    set<string> C;
    for(int i=0;i<M;i++){
        string c;
        cin>>c;
        C.insert(c);
    }
    int ans=0;
    for(int l=1;l<=10;l++){
        for(int i=0;i+l<=S.size();i++){
            if(C.find(S.substr(i,l))!=C.end()){
                ans++;
            }
        }
    }
    cout<<ans<<endl;
    return 0;
}
0