#include<bits/stdc++.h>
#define ll long long
#define fi first
#define se second
using namespace std;
const ll MOD = 1e9+7;
const ll INF = 1e18;
void solve(){
ll n; cin >> n;
ll non[n+5];
for(ll i=0; i<n; i++){
cin >> non[i];
}
ll ans = 0;
ll m; cin >> m;
while(m--){
ll k; cin >> k;
ll arr[k+5];
for(ll i=0; i<k; i++){
cin >> arr[i];
}
bool ada = 1;
for(ll i=0; i<n; i++){
if(ada){
for(ll j=0; j<k; j++){
if(non[i] == arr[j]){
ada = 0;
break;
}
}
}else break;
}
if(ada) ans++;
}
cout << ans;
}
int main(){
ll t=1; //cin >> t;
while(t--){
solve();
}
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |