#include<bits/stdc++.h>
#define ll long long
using namespace std;
//masukan camilan yang tidak disukai ke set
//msukan bingkisan, cek apakah ada set, kalau tidak tambah ans
int main(){
ll n; cin>>n;
bool cemilan[105];
memset (cemilan, true, 105);
for(ll i=1; i<=n; i++){
ll a; cin>>a;
cemilan[a]=false;
}
ll m; cin>>m;
ll ans =0;
for(ll i=1; i<=m; i++){
bool cek=true;
ll k; cin>>k;
for(ll j=1; j<=k; j++){
ll b; cin>>b;
if(cemilan[b]==false){
cek=false;
}
}
if(cek==true){
ans++;
}
}
cout<<ans<<endl;
}
# |
결과 |
실행 시간 |
메모리 |
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 |
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 |
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 |
344 KB |
Output is correct |