Submission #373769

# Submission time Handle Problem Language Result Execution time Memory
373769 2021-03-05T17:40:26 Z Nimbostratus Pizza (COCI21_pizza) C++17
50 / 50
1 ms 384 KB
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define ub upper_bound
#define lb lower_bound
#define clean(a,s) memset((a),0,sizeof((a)[0])*(s))
#define all(x) (x).begin() , (x).end()
#define fi first
#define se second
#define int int
using pii = pair<int,int>;
using ll = long long;
const int maxn = 200;
const int inf = 2e9;
const int mod = 1e9+7;

int n,m,ans;
bool bad[maxn];

int32_t main () {
	//freopen("in","r",stdin); freopen("out","w",stdout);
	ios_base::sync_with_stdio(0); cout.tie(0); cin.tie(0);
	cin >> n;
	for(int i=1,x;i<=n;i++) {
		cin >> x;
		bad[x] = true;
	}
	cin >> m;
	for(int i=1,k,x;i<=m;i++) {
		cin >> k;
		bool f = true;
		while(k--) {
			cin >> x;
			f = f && !bad[x];
		}
		ans += f;
	}
	cout << ans << endl;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 384 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct