#include <iostream>
#include <set>
using namespace std;
int main() {
int n;
cin >> n;
set<int> disliked_toppings;
for (int i = 0; i < n; ++i) {
int topping;
cin >> topping;
disliked_toppings.insert(topping);
}
int m;
cin >> m;
int valid_pizza_count = 0;
for (int i = 0; i < m; ++i) {
int k;
cin >> k;
bool valid = true;
for (int j = 0; j < k; ++j) {
int topping;
cin >> topping;
if (disliked_toppings.count(topping) > 0) {
valid = false;
}
}
if (valid) {
valid_pizza_count++;
}
}
cout << valid_pizza_count << endl;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |