#include <bits/stdc++.h>
using namespace std;
#ifdef MIKU
string dbmc = "\033[1;38;2;57;197;187m", dbrs = "\033[0m";
#define debug(x...) cout << dbmc << "[" << #x << "]: ", dout(x)
void dout() { cout << dbrs << endl; }
template <typename T, typename ...U>
void dout(T t, U ...u) { cout << t << (sizeof...(u) ? ", " : ""); dout(u...); }
#else
#define debug(...) 39
#endif
#define fs first
#define sc second
#define mp make_pair
#define FOR(i, j, k) for (int i = j, Z = k; i < Z; i++)
using ll = long long;
typedef pair<int, int> pii;
const int MXN = 500005;
int n, m;
vector<int> edge[MXN];
bitset<MXN> ban;
vector<int> ans;
void miku() {
int x, y;
cin >> n >> m;
while (m--) {
cin >> x >> y;
edge[x].push_back(y);
edge[y].push_back(x);
}
FOR(id, 1, n + 1) {
if (ban[id]) continue;
ans.push_back(id);
for (auto &i : edge[id]) ban[i] = true;
}
cout << ans.size() << '\n';
for (auto &i : ans) cout << i << ' ';
cout << '\n';
}
int32_t main() {
cin.tie(0) -> sync_with_stdio(false);
cin.exceptions(cin.failbit);
miku();
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
118 ms |
36072 KB |
Output is correct |
2 |
Correct |
106 ms |
35972 KB |
Output is correct |
3 |
Correct |
3 ms |
12124 KB |
Output is correct |
4 |
Correct |
33 ms |
17528 KB |
Output is correct |
5 |
Correct |
75 ms |
33836 KB |
Output is correct |
6 |
Correct |
72 ms |
32192 KB |
Output is correct |
7 |
Correct |
72 ms |
33744 KB |
Output is correct |
8 |
Correct |
77 ms |
31940 KB |
Output is correct |
9 |
Correct |
233 ms |
37332 KB |
Output is correct |
10 |
Correct |
150 ms |
35012 KB |
Output is correct |
11 |
Correct |
204 ms |
36996 KB |
Output is correct |
12 |
Correct |
266 ms |
33792 KB |
Output is correct |
13 |
Correct |
143 ms |
34496 KB |
Output is correct |
14 |
Correct |
134 ms |
34500 KB |
Output is correct |
15 |
Correct |
146 ms |
34504 KB |
Output is correct |
16 |
Correct |
118 ms |
34560 KB |
Output is correct |
17 |
Correct |
36 ms |
17236 KB |
Output is correct |
18 |
Correct |
53 ms |
19852 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
103 ms |
36088 KB |
Output is correct |
2 |
Correct |
71 ms |
32772 KB |
Output is correct |
3 |
Correct |
70 ms |
32692 KB |
Output is correct |
4 |
Correct |
195 ms |
36512 KB |
Output is correct |
5 |
Correct |
238 ms |
35804 KB |
Output is correct |
6 |
Correct |
135 ms |
34628 KB |
Output is correct |
7 |
Correct |
127 ms |
34680 KB |
Output is correct |
8 |
Correct |
130 ms |
34804 KB |
Output is correct |
9 |
Correct |
116 ms |
34484 KB |
Output is correct |
10 |
Correct |
32 ms |
16976 KB |
Output is correct |
11 |
Correct |
29 ms |
15952 KB |
Output is correct |
12 |
Correct |
28 ms |
16160 KB |
Output is correct |
13 |
Correct |
103 ms |
35044 KB |
Output is correct |
14 |
Correct |
118 ms |
36540 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
12376 KB |
Output is correct |
2 |
Correct |
4 ms |
12380 KB |
Output is correct |
3 |
Correct |
5 ms |
12380 KB |
Output is correct |
4 |
Correct |
4 ms |
12376 KB |
Output is correct |
5 |
Correct |
5 ms |
12376 KB |
Output is correct |
6 |
Correct |
5 ms |
12532 KB |
Output is correct |
7 |
Correct |
4 ms |
12380 KB |
Output is correct |
8 |
Correct |
4 ms |
12380 KB |
Output is correct |
9 |
Correct |
5 ms |
12124 KB |
Output is correct |
10 |
Correct |
3 ms |
12124 KB |
Output is correct |
11 |
Correct |
4 ms |
12124 KB |
Output is correct |
12 |
Correct |
4 ms |
12380 KB |
Output is correct |
13 |
Correct |
4 ms |
12380 KB |
Output is correct |
14 |
Correct |
3 ms |
12124 KB |
Output is correct |
15 |
Correct |
4 ms |
12380 KB |
Output is correct |
16 |
Correct |
4 ms |
12332 KB |
Output is correct |
17 |
Correct |
4 ms |
12380 KB |
Output is correct |
18 |
Correct |
3 ms |
12124 KB |
Output is correct |
19 |
Correct |
4 ms |
12124 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
118 ms |
36072 KB |
Output is correct |
2 |
Correct |
106 ms |
35972 KB |
Output is correct |
3 |
Correct |
3 ms |
12124 KB |
Output is correct |
4 |
Correct |
33 ms |
17528 KB |
Output is correct |
5 |
Correct |
75 ms |
33836 KB |
Output is correct |
6 |
Correct |
72 ms |
32192 KB |
Output is correct |
7 |
Correct |
72 ms |
33744 KB |
Output is correct |
8 |
Correct |
77 ms |
31940 KB |
Output is correct |
9 |
Correct |
233 ms |
37332 KB |
Output is correct |
10 |
Correct |
150 ms |
35012 KB |
Output is correct |
11 |
Correct |
204 ms |
36996 KB |
Output is correct |
12 |
Correct |
266 ms |
33792 KB |
Output is correct |
13 |
Correct |
143 ms |
34496 KB |
Output is correct |
14 |
Correct |
134 ms |
34500 KB |
Output is correct |
15 |
Correct |
146 ms |
34504 KB |
Output is correct |
16 |
Correct |
118 ms |
34560 KB |
Output is correct |
17 |
Correct |
36 ms |
17236 KB |
Output is correct |
18 |
Correct |
53 ms |
19852 KB |
Output is correct |
19 |
Correct |
103 ms |
36088 KB |
Output is correct |
20 |
Correct |
71 ms |
32772 KB |
Output is correct |
21 |
Correct |
70 ms |
32692 KB |
Output is correct |
22 |
Correct |
195 ms |
36512 KB |
Output is correct |
23 |
Correct |
238 ms |
35804 KB |
Output is correct |
24 |
Correct |
135 ms |
34628 KB |
Output is correct |
25 |
Correct |
127 ms |
34680 KB |
Output is correct |
26 |
Correct |
130 ms |
34804 KB |
Output is correct |
27 |
Correct |
116 ms |
34484 KB |
Output is correct |
28 |
Correct |
32 ms |
16976 KB |
Output is correct |
29 |
Correct |
29 ms |
15952 KB |
Output is correct |
30 |
Correct |
28 ms |
16160 KB |
Output is correct |
31 |
Correct |
103 ms |
35044 KB |
Output is correct |
32 |
Correct |
118 ms |
36540 KB |
Output is correct |
33 |
Correct |
4 ms |
12376 KB |
Output is correct |
34 |
Correct |
4 ms |
12380 KB |
Output is correct |
35 |
Correct |
5 ms |
12380 KB |
Output is correct |
36 |
Correct |
4 ms |
12376 KB |
Output is correct |
37 |
Correct |
5 ms |
12376 KB |
Output is correct |
38 |
Correct |
5 ms |
12532 KB |
Output is correct |
39 |
Correct |
4 ms |
12380 KB |
Output is correct |
40 |
Correct |
4 ms |
12380 KB |
Output is correct |
41 |
Correct |
5 ms |
12124 KB |
Output is correct |
42 |
Correct |
3 ms |
12124 KB |
Output is correct |
43 |
Correct |
4 ms |
12124 KB |
Output is correct |
44 |
Correct |
4 ms |
12380 KB |
Output is correct |
45 |
Correct |
4 ms |
12380 KB |
Output is correct |
46 |
Correct |
3 ms |
12124 KB |
Output is correct |
47 |
Correct |
4 ms |
12380 KB |
Output is correct |
48 |
Correct |
4 ms |
12332 KB |
Output is correct |
49 |
Correct |
4 ms |
12380 KB |
Output is correct |
50 |
Correct |
3 ms |
12124 KB |
Output is correct |
51 |
Correct |
4 ms |
12124 KB |
Output is correct |
52 |
Correct |
105 ms |
36048 KB |
Output is correct |
53 |
Correct |
74 ms |
32860 KB |
Output is correct |
54 |
Correct |
83 ms |
32948 KB |
Output is correct |
55 |
Correct |
195 ms |
36520 KB |
Output is correct |
56 |
Correct |
266 ms |
36016 KB |
Output is correct |
57 |
Correct |
141 ms |
34608 KB |
Output is correct |
58 |
Correct |
130 ms |
34740 KB |
Output is correct |
59 |
Correct |
127 ms |
34760 KB |
Output is correct |
60 |
Correct |
34 ms |
17244 KB |
Output is correct |
61 |
Correct |
32 ms |
15956 KB |
Output is correct |
62 |
Correct |
28 ms |
16004 KB |
Output is correct |
63 |
Correct |
110 ms |
35268 KB |
Output is correct |
64 |
Correct |
106 ms |
35732 KB |
Output is correct |
65 |
Correct |
31 ms |
16408 KB |
Output is correct |
66 |
Correct |
228 ms |
34684 KB |
Output is correct |
67 |
Correct |
136 ms |
34960 KB |
Output is correct |
68 |
Correct |
138 ms |
34556 KB |
Output is correct |
69 |
Correct |
31 ms |
17232 KB |
Output is correct |
70 |
Correct |
90 ms |
25868 KB |
Output is correct |