#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define nl "\n"
#define ll long long
#define str string
#define dl double
#define ts(val) to_string(val)
#define ti(val) stoi(val)
#define ft first
#define sc second
#define Pb push_back
#define pB pop_back
#define mp make_pair
#define mst(array,value) memset(array,value,sizeof(array))
#define gtr greater<int>()
#define all(ar) ar.begin(),ar.end()
using namespace std;
#define ull unsigned long long int
//#define int long long
bool no[100+5];
signed main() {
fast
int n; cin >> n;
for(int i=0;i<n;i++) {
int val; cin >> val;
no[val] = true;
}
int m; cin >> m;
int cnt = 0;
while(m--) {
int k; cin >> k;
bool yes = true;
for(int i=0;i<k;i++) {
int val; cin >> val;
if(no[val]) yes = false;
}
if(yes) cnt++;
}
cout << cnt << nl;
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 |
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 |
1 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |