이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
/**
/> フ
| _ _|
/`ミ _x 彡
/ |
/ ヽ |
/ ̄| | | |
| ( ̄ヽ__ヽ_)_)
\二つ
**/
#include<bits/stdc++.h>
#define ll long long
#define pii pair<int, int>
#define fi first
#define se second
#define ALL(v) v.begin(), v.end()
#define pb push_back
#define MP make_pair
#define MT make_tuple
#define typeT tuple<ll, int, int>
#define FOR(i, a, b) for (int i = (a), _b = (b); i <= _b; i++)
#define FOD(i, a, b) for (int i = (a), _b = (b); i >= _b; i--)
#define MASK(i) (1LL << (i))
#define BIT(k, i) (((k) >> (i)) & 1)
const int N = 1e5 + 5;
using namespace std;
int n, m, k;
int cnt[N];
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
#define task "a"
// freopen(task".inp", "r", stdin);
//freopen(task".out", "w", stdout);
cin >> n >> m >> k;
FOR(i, 1, n - 1) {
int u, v; cin >> u >> v;
}
FOR(i, 1, m) {
int s; cin >> s;
FOR(j, 1, s) {
int x; cin >> x;
cnt[x]++;
}
}
int res = 0;
FOR(i, 1, n - 1) if (cnt[i] >= k) res++;
cout << res << "\n";
FOR(i, 1, n - 1) if (cnt[i] >= k) cout << i << " ";
return 0;
}
# | 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... |