eolymp
bolt
Try our new interface for solving problems
Problems

Sets Union

published at 2/15/22, 7:35:32 pm

памагити

published at 2/2/24, 10:50:13 pm

include <bits/stdc++.h>

using namespace std; int main(){ int n,k,x; cin>>n; set<int>t; for (int i=0;i<n;i++){ cin>>k; for (int j=0;j<k;j++){ cin>>x; t.insert(x); } } cout<<t.size(); }

published at 3/12/24, 9:46:35 pm

include <iostream>

include <vector>

include <set>

using namespace std;

int main() { int n; cin>>n; set<int>st; for(int i=0; i<n; i++) { int a; cin>>a; for(int j=0; j<a; j++) { int k; cin>>k; st.insert(k); } }

cout<<st.size(); 

return 0;

}