Submission #974546

# Submission time Handle Problem Language Result Execution time Memory
974546 2024-05-03T12:47:14 Z vjudge1 Pizza (COCI21_pizza) C++17
50 / 50
1 ms 604 KB
#include <bits/stdc++.h>
using namespace std;

bool isLiked;
int n, a[101], m, k, b[101], ans;

int main(){
	cin >> n;
	for (int i = 0; i < n; i++){
		cin >> a[i];
	}
	sort (a, a+n);
	cin >> m;
	for (int i = 0; i < m; i++){
		isLiked = true;
		cin >> k;
		for (int j = 0; j < k; j++){
			cin >> b[j];
		}
		sort(b, b+k);
		int idx = 0;
		for (int j = 0; j < k; j++){
			while (b[j] > a[idx] && a[idx] != 0){
				idx++;
			}
			if (a[idx] == 0){
				break;
			}
			if (b[j] == a[idx]){
				isLiked = false;
				break;
			}
			
		}
		if (isLiked == true){
			ans++;
		}
	}
	cout << ans;
	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 432 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 376 KB Output is correct
# 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 604 KB Output is correct
2 Correct 1 ms 348 KB Output is correct