#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define fi first
#define se second
#define endl '\n'
#define mp make_pair
#define pb push_back
const ll mod = 1e9 + 7;
const ll MAX = INT_MAX;
string biner(ll n) {
if(n == 0) return "0";
else if(n == 1) return "1";
else if(n % 2 == 1) return biner(n / 2) + "1";
else return biner(n / 2) + "0";
}
ll fpangkat(ll a, ll b) {
ll result = 1;
while(b) {
if(b % 2 == 1) {
result = result * a;
result %= mod;
}
b /= 2;
a = a * a;
a %= mod;
}
return result;
}
bool cmp(pair<ll, pair<ll, ll>>a, pair<ll, pair<ll, ll>>b) {
if(a.se.fi * (b.se.fi + b.se.se) == b.se.fi * (a.se.fi + a.se.se)) {
return a.fi < b.fi;
} else {
if(a.se.fi * (b.se.fi + b.se.se) > b.se.fi * (a.se.fi + a.se.se)) {
return true;
} else {
return false;
}
}
}
ll faktorial(ll a) {
if(a == 0) return 1;
return a * faktorial(a - 1);
}
vector<ll> adj[100005];
bool vis[100005];
void dfs(ll x) {
for(auto x : adj[x]) {
if(vis[x] == false) {
vis[x] = true;
dfs(x);
}
}
}
ll prefix(ll a) {
return a * (a + 1) / 2;
}
// ll n;
ll memo[100005];
ll pois[100005];
// ll dp(ll i, ll a) {
// if(i > n) return 0;
// if(a + pois[i] < 0) return dp(i + 1, a);
// if(memo[i] != -1) {
// return memo[i];
// }
// return memo[i] = max(1 + dp(i + 1, a + pois[i]), dp(i + 1, a));
// }
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
// ^^fomo^^
ll n; cin >> n;
vector<ll> v;
for(ll i = 0; i < n; i++) {
ll x; cin >> x;
v.pb(x);
}
ll ans = 0;
ll q; cin >> q;
while(q--) {
ll a; cin >> a;
bool valid = true;
while(a--) {
ll b; cin >> b;
for(ll i = 0; i < n; i++) {
if(b == v[i]) {
valid = false;
break;
}
}
}
if(valid) ans++;
}
cout << ans << 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... |