Submission #977143

# Submission time Handle Problem Language Result Execution time Memory
977143 2024-05-07T12:17:34 Z vjudge1 Pizza (COCI21_pizza) C++17
50 / 50
1 ms 348 KB
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define fi first
#define sec second
#define pii pair<ll,ll>
 
const ll N = 1e5 + 5;
const ll MOD = 1e9 + 7;

signed main(){
	ios_base::sync_with_stdio(false); cin.tie(nullptr);
	ll tc = 1;
	// cin >> tc;
	while(tc--){
		ll n; cin >> n;
		vector<ll>mark(105);
		for(int i=1;i<=n;i++){
			ll x; cin >> x;
			mark[x] = 1;
		}
		ll m; cin >> m;
		ll ans = 0;
		for(int i=1;i<=m;i++){
			ll k; cin >> k;
			bool bs = 1;
			for(int j=1;j<=k;j++){
				ll x; cin >> x;
				if(mark[x]) bs = 0;
			}
			ans += bs;
		}
		cout << ans << endl;
	}
}
# 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 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