#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define all(v) v.begin(),v.end()
#define forn(i,n) for(int i = 1; i<=n; i++)
using namespace std;
int main(){
ll n,m;
cin >> n;
ll arr[n+99];
forn(i,n)cin>>arr[i];
cin >> m;
set<ll> bingkisan[m+99];
forn(i,m){
ll x;
cin >> x;
forn(j,x){
ll k;
cin >> k;
bingkisan[i].insert(k);
}
}
ll bisa = m;
forn(i,m){
forn(j,n){
if(bingkisan[i].find(arr[j]) != bingkisan[i].end()){
bisa--;
break;
}
}
}
cout<<bisa;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
432 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 |
1 ms |
440 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
344 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
436 KB |
Output is correct |