Submission #875391

# Submission time Handle Problem Language Result Execution time Memory
875391 2023-11-19T13:09:41 Z BvoJa Railway (BOI17_railway) C++11
0 / 100
24 ms 2500 KB
/**
       />  フ
       |  _  _|
       /`ミ _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
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 24 ms 2500 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 20 ms 2396 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 20 ms 2396 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -