Submission #975879

# Submission time Handle Problem Language Result Execution time Memory
975879 2024-05-06T01:51:23 Z vjudge1 Pizza (COCI21_pizza) C++17
50 / 50
1 ms 348 KB
#include <bits/stdc++.h>
#define int long long
using namespace std;
bool hate[105];
void solve(){
	int n; cin >> n;
	for(int i = 0;i<n;i++){
		int tmp; cin >> tmp;
		hate[tmp] = true; //tidak suka
	}
	int m; cin >> m;
	int cnt = 0;
	for(int i =0;i<m;i++){
		int k; cin >> k;
		bool ok = true;
		for(int j = 0;j<k;j++){
			int tmp; cin >> tmp;
			if(hate[tmp]){
				ok = false;
			}
		}
		if(ok) cnt++;
	}
	cout << cnt << endl;
}

signed main (){
	solve();
	return 0;
}
# 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 0 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 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 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