Submission #976468

# Submission time Handle Problem Language Result Execution time Memory
976468 2024-05-06T15:09:40 Z vjudge1 Pizza (COCI21_pizza) C++17
50 / 50
1 ms 540 KB
#include <iostream>
#include <vector>
#include <cstring>
using namespace std;
typedef long long ll;

bool tidak[1000];

int main() {
	memset(tidak, 0, sizeof(tidak));

	int n; cin >> n;
	for (int i = 0; i < n; i++) {
		int a; cin >> a;
		tidak[a] = 1;
	}

	int m; cin >> m;
	int cnt = 0;

	for (int i = 0; i < m; i++) {
		int k; cin >> k;
		bool ambil = 1;  
		for (int j = 0; j < k; j++) {
			int b; cin >> b;
			if (tidak[b]) ambil = 0;
		}
		if (ambil) cnt++;
	}

	cout << cnt << endl;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 540 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 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 1 ms 348 KB Output is correct