Submission #875391

#TimeUsernameProblemLanguageResultExecution timeMemory
875391BvoJaRailway (BOI17_railway)C++11
0 / 100
24 ms2500 KiB
/**      />  フ      |  _  _|      /`ミ _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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...