Submission #975504

# Submission time Handle Problem Language Result Execution time Memory
975504 2024-05-05T11:00:36 Z vjudge1 Pizza (COCI21_pizza) C++17
50 / 50
1 ms 348 KB
#include <bits/stdc++.h>
using namespace std;

int main(){
	int n;cin>>n;
	int a[n];
	for(int i=0;i<n;i++){
		cin>>a[i];
	}
	int m;cin>>m;
	int k[m], ans[m];
	memset(ans,0,sizeof(ans));
	int b[m][101];
	for(int i=0;i<m;i++){
		cin>>k[i];
		for(int j=0;j<k[i];j++){
			cin>>b[i][j];
		}
	}
	
	for(int i=0;i<m;i++){
		for(int j=0;j<k[i];j++){
			for(int k=0;k<n;k++){
				if(b[i][j]==a[k]){
					ans[i]++;
				}
			}
		}
	}
	
	int cnt=0;
	for(int i=0;i<m;i++){
		if(ans[i]>0){
			continue;
		}else{
			cnt++;
		}
	}
	
	cout<<cnt<<endl;
	
	return 0;
}
# 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
# 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 0 ms 344 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 344 KB Output is correct