Submission #975489

# Submission time Handle Problem Language Result Execution time Memory
975489 2024-05-05T10:09:24 Z vjudge1 Pizza (COCI21_pizza) C++17
50 / 50
1 ms 348 KB
#include <bits/stdc++.h>
using namespace std;
#define ll long long

int main(){
	ll n, m, ans = 0; cin >> n;
	vector<ll> v(n);
	for(ll i = 0; i < n; i++){
		cin >> v[i];
	}
	cin >> m;
	while(m--){
		ll x;
		cin >> x;
		bool ok = true;
		unordered_set<ll> s;
		for(ll i = 0; i < x; i++){
			ll c;
			cin >> c;
			s.insert(c);
		}
		for(auto &i : v){
			if(s.find(i) != s.end()){
				ok = false;
				break;
			}
		}
		if(ok) ans++;
	}
	cout << ans;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct