///@author Sycamore, ZJNU ///@date 2017-02-09 #include<iostream> #include<string> #include<vector> #include<algorithm> using namespace std; int main() { int N; cin >> N; vector<string>v(N); for (auto &e : v)cin >> e; int K, n; cin >> K; while (K--) { int c = 0; cin >> n; string t; while (n--) { cin >> t; if (find(v.begin(), v.end(), t) != v.end())c++; } cout << c << endl; } return 0; }
转载于:https://www.cnblogs.com/zjnu/p/7258558.html