結果

問題 No.430 文字列検索
ユーザー task4233task4233
提出日時 2018-04-01 19:58:21
言語 C++11
(gcc 11.4.0)
結果
TLE  
実行時間 -
コード長 1,253 bytes
コンパイル時間 1,222 ms
コンパイル使用メモリ 147,096 KB
実行使用メモリ 9,000 KB
最終ジャッジ日時 2023-09-08 12:32:46
合計ジャッジ時間 7,659 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

// ------------------------------------
// Date:2018/ 4/ 1
// Problem:No.493 とても長い数列と文字列 / 0493.cpp
//
// ------------------------------------

#include <bits/stdc++.h>

using namespace std;

#define EACH(i,a) for (auto& i : a)
#define FOR(i,a,b) for(int i=(int)a;i<(int)b;++i)
#define RFOR(i,a,b) for(int i=(int)b-1;i>=(int)a;--i)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(a) (a).begin(),(a).end()
#define debug(x) cerr << #x << ":" << x << endl;
#define OK(ok) cout << (ok ? "Yes" : "No") << endl;
typedef long long ll;

void CINT(){}
template <class Head,class... Tail>
void CINT(Head&& head,Tail&&... tail) {
  cin >> head; CINT(move(tail)...);
}
#define CIN(...) int __VA_ARGS__;CINT(__VA_ARGS__)
#define LCIN(...) ll __VA_ARGS__;CINT(__VA_ARGS__)
#define SCIN(...) string __VA_ARGS__;CINT(__VA_ARGS__)

const int INF = 1e9 + 1;
const int MOD = 1e9 + 7;
const int MAX_N = 1e5 + 1;

int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);

  SCIN(S);
  CIN(M);
  vector< string > C(M);
  REP(i, M)
    cin >> C[i];

  ll ans = 0ll;
  REP(i, M) {
    REP(j, S.size()) {
      string tmp = S.substr(j, C[i].size());
      if (tmp == C[i]) ans++;
    }
  }

  cout << ans << endl;
  

  return 0;
}

0