Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void solve()
- {
- int n;
- cin >> n;
- si total;
- vector<vi> sets(n);
- f(i, 0, n)
- {
- int x;
- cin >> x;
- while(x--)
- {
- int y;
- cin >> y;
- sets[i].pb(y);
- total.insert(y);
- }
- sort(all(sets[i]));
- }
- int maxans = -1;
- for(auto ele : total)
- {
- si aux;
- f(i, 0, n)
- {
- if(!binary_search(all(sets[i]), ele))
- {
- for(auto j : sets[i])
- {
- aux.insert(j);
- }
- }
- }
- maxans = max(maxans, (int)aux.size());
- }
- println(maxans);
- }
Advertisement
Add Comment
Please, Sign In to add comment