This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define ll long long
const ll sz=2005;
/*
{} []
*/
int main()
{
ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
ll n, m, k;
cin>>n>>m>>k;
for(int i=1; i<n; i++){
ll a, b;
cin>>a>>b;
}
set<ll>s;
map<ll, ll>mp;
for(int i=1; i<=m; i++){
ll x;
cin>>x;
for(int j=1; j<=x; j++){
ll t;
cin>>t;
mp[t]++;
}
}
for(auto i:mp){
if(i.second>=k){
s.insert(i.first);
}
}
cout<<s.size()<<endl;
for(auto i:s) cout<<i<<' ';
}
/*
{} []
*/
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |