結果
| 問題 |
No.430 文字列検索
|
| コンテスト | |
| ユーザー |
chocorusk
|
| 提出日時 | 2019-05-26 10:24:25 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 176 ms / 2,000 ms |
| コード長 | 834 bytes |
| コンパイル時間 | 948 ms |
| コンパイル使用メモリ | 107,364 KB |
| 実行使用メモリ | 33,500 KB |
| 最終ジャッジ日時 | 2024-11-10 00:25:49 |
| 合計ジャッジ時間 | 2,150 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 14 |
ソースコード
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#define popcount __builtin_popcount
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
int main()
{
string s;
cin>>s;
int n=s.size();
unordered_map<string, ll> mp;
for(int i=0; i<n; i++){
string t;
for(int j=0; j<10 && i+j<n; j++){
t+=s[i+j];
mp[t]++;
}
}
ll ans=0;
int m; cin>>m;
for(int i=0; i<m; i++){
string c; cin>>c;
ans+=mp[c];
}
cout<<ans<<endl;
return 0;
}
chocorusk