Submission #974958

# Submission time Handle Problem Language Result Execution time Memory
974958 2024-05-04T07:55:35 Z vjudge1 Pizza (COCI21_pizza) C++17
50 / 50
1 ms 440 KB
#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;
}
# Verdict Execution time Memory Grader output
1 Correct 0 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 432 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 440 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 436 KB Output is correct