//Author RufatM
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<pii> vpii;
typedef vector<vector<int>> vvi;
typedef vector<ll> vll;
typedef vector<bool> vb;
typedef vector<string> vs;
typedef map<int,int> mpii;
typedef map<bool,int> mpbi;
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define endl '\n'
#define pb push_back
#define pf push_front
#define eb emplace_back
#define ff first
#define ss second
#define all(x) begin(x),end(x)
#define precise(x) cout << fixed << setprecision(x);
#define rall(x) rbegin(x),rend(x)
#define ordered_set tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>
const int MOD=1000003;
const int INF=1e9;
const ll LINF=1e18;
const int MAXN=2005;
ll add(ll a,ll b){
return (a+b)%MOD;
}
ll sub(ll a,ll b){
return (a-b+MOD)%MOD;
}
ll mul(ll a,ll b){
return (a*b)%MOD;
}
ll binpow(ll a,ll b){
ll res=1;
while(b>0){
if(b&1){
res=mul(res,a);
}
a=mul(a,a);
b>>=1;
}
return res;
}
ll modinv(ll a){
return binpow(a,MOD-2);
}
void solve(){
int n;
cin >> n;
bool flag[101] = {0};
for(int i=0;i<n;i++){
int x;
cin >> x;
flag[x] = 1;
}
int m;
cin >> m;
int ans = 0;
for(int i=0;i<m;i++){
int k;
cin >> k;
bool ok = 1;
for(int j=0;j<k;j++){
int x;
cin >> x;
if(flag[x]){
ok = 0;
}
}
ans += ok;
}
cout << ans << endl;
}
signed main(){
fastio;
int t=1;
//cin >> t;
while(t--){
solve();
}
}
| # | 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... |