Submission #971282

# Submission time Handle Problem Language Result Execution time Memory
971282 2024-04-28T10:37:09 Z vjudge1 Pizza (COCI21_pizza) C++11
50 / 50
1 ms 348 KB
#include <bits/stdc++.h>
using namespace std;

const int MAXN = 1e2;

int n,m;
int a[MAXN+5], k[MAXN+5];

int b[MAXN + 5][MAXN +5];

bool cekSama(int x) {
	
	for( int i = 0; i < k[x]; i++) {
		
		for( int j = 0; j< m; j++) {
			if(a[j] == b[x][i]){
				return false;
			}
			else{
				continue;
			}
		}
	}
	return true;
}

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	
	cin >> n;
	for( int i = 0; i < n; i++) {
		cin >> a[i];
	}
	
	cin >> m;
	for( int i = 0; i < m; i++) {
		cin >> k[i];
		for(int j = 0; j < k[i]; j++) {
			cin >> b[i][j];
		}
	}
	int ans = 0;
	for( int i = 0; i < m; i++) {
		
		if( cekSama(i)) ans++;
		else continue;
	}
	cout << ans;
}
# 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 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 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 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct