Submission #976391

# Submission time Handle Problem Language Result Execution time Memory
976391 2024-05-06T13:56:53 Z vjudge1 Pizza (COCI21_pizza) C++17
50 / 50
1 ms 600 KB
#include<bits/stdc++.h>
#define ll long long
#define nitro ios_base::sync_with_stdio;cin.tie(0);cout.tie(0);
using namespace std;

int n,m,k,ans=0;
int a[101],b[101];
//bool binser(){
//	bool temp=true;
//	int low=1;
//	int high=k;
//	int mid;
//	for(int i=1;i<=n;i++){
////		cout<<"cari "<<a[i]<<endl;
//		while(low<=high&&temp==true){
////			cout<<b[mid]<<endl;
//			mid=(low+high)/2;
//			if(a[i]<b[mid]){
//				high=mid-1;
//			}
//			else if(a[i]>b[mid]){
//				low=mid+1;
//			} 
//			else if(a[i]==b[mid]){
//				return false;
//			}
//		}
//		low=1;
//		high=k;
//	}
//	return true;
//}


int main(){
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>a[i];
	}
	cin>>m;
	for(int i=1;i<=m;i++){
		cin>>k;
		for(int i=1;i<=k;i++){
			cin>>b[i];
		}
		bool ada=false;
		for(int i=1;i<=n;i++){
			for(int j=1;j<=k;j++){
				if(a[i]==b[j]){
					ada=true;
					break;
				}
			}
		}
		if(!ada){
			ans++;
		}
	}
	cout<<ans;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 504 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 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 600 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
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct