Submission #1114651

# Submission time Handle Problem Language Result Execution time Memory
1114651 2024-11-19T10:14:31 Z NotLinux Povjerenstvo (COI22_povjerenstvo) C++17
100 / 100
272 ms 38852 KB
// Author : FatihCihan
#include <bits/stdc++.h>
using namespace std;
#define all(v) v.begin() , v.end()
#define sz(a) (int)a.size()
void solve(){
	int n,m;
	cin >> n >> m;
	vector < int > graph[n];
	for(int i = 0;i<m;i++){
		int a,b;
		cin >> a >> b;
		a-- , b--;
		graph[a].push_back(b);
		graph[b].push_back(a);
	}
	int vis[n] = {0};
	vector < int > ans;
	for(int i = 0;i<n;i++){
		if(vis[i] == 0){
			ans.push_back(i+1);
			for(auto itr : graph[i]){
				vis[itr] = 1;
			}
		}
	}
	cout << sz(ans) << endl;
	for(auto itr : ans){
		cout << itr << " ";
	}
	cout << endl;
}
signed main(){
	ios_base::sync_with_stdio(0);cin.tie(0);
	int testcase = 1;//cin >> testcase;
	while(testcase--)solve();
	cerr << 1000.0 * clock() / CLOCKS_PER_SEC << " ms" << endl;
}
# Verdict Execution time Memory Grader output
1 Correct 106 ms 37324 KB Output is correct
2 Correct 110 ms 37052 KB Output is correct
3 Correct 1 ms 336 KB Output is correct
4 Correct 39 ms 18892 KB Output is correct
5 Correct 84 ms 35664 KB Output is correct
6 Correct 80 ms 33464 KB Output is correct
7 Correct 91 ms 35640 KB Output is correct
8 Correct 83 ms 32952 KB Output is correct
9 Correct 168 ms 38852 KB Output is correct
10 Correct 162 ms 35516 KB Output is correct
11 Correct 229 ms 38588 KB Output is correct
12 Correct 272 ms 34676 KB Output is correct
13 Correct 155 ms 35516 KB Output is correct
14 Correct 152 ms 35808 KB Output is correct
15 Correct 141 ms 35772 KB Output is correct
16 Correct 127 ms 35960 KB Output is correct
17 Correct 28 ms 5736 KB Output is correct
18 Correct 55 ms 8264 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 113 ms 37316 KB Output is correct
2 Correct 78 ms 34156 KB Output is correct
3 Correct 75 ms 34232 KB Output is correct
4 Correct 225 ms 37828 KB Output is correct
5 Correct 213 ms 38588 KB Output is correct
6 Correct 144 ms 36796 KB Output is correct
7 Correct 152 ms 37024 KB Output is correct
8 Correct 135 ms 36800 KB Output is correct
9 Correct 124 ms 36584 KB Output is correct
10 Correct 28 ms 5460 KB Output is correct
11 Correct 27 ms 5880 KB Output is correct
12 Correct 25 ms 5712 KB Output is correct
13 Correct 110 ms 35800 KB Output is correct
14 Correct 121 ms 38080 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 592 KB Output is correct
2 Correct 2 ms 592 KB Output is correct
3 Correct 2 ms 592 KB Output is correct
4 Correct 2 ms 592 KB Output is correct
5 Correct 2 ms 592 KB Output is correct
6 Correct 2 ms 848 KB Output is correct
7 Correct 2 ms 760 KB Output is correct
8 Correct 2 ms 592 KB Output is correct
9 Correct 2 ms 336 KB Output is correct
10 Correct 1 ms 508 KB Output is correct
11 Correct 1 ms 336 KB Output is correct
12 Correct 2 ms 592 KB Output is correct
13 Correct 2 ms 592 KB Output is correct
14 Correct 1 ms 336 KB Output is correct
15 Correct 3 ms 592 KB Output is correct
16 Correct 2 ms 592 KB Output is correct
17 Correct 2 ms 592 KB Output is correct
18 Correct 1 ms 336 KB Output is correct
19 Correct 2 ms 764 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 106 ms 37324 KB Output is correct
2 Correct 110 ms 37052 KB Output is correct
3 Correct 1 ms 336 KB Output is correct
4 Correct 39 ms 18892 KB Output is correct
5 Correct 84 ms 35664 KB Output is correct
6 Correct 80 ms 33464 KB Output is correct
7 Correct 91 ms 35640 KB Output is correct
8 Correct 83 ms 32952 KB Output is correct
9 Correct 168 ms 38852 KB Output is correct
10 Correct 162 ms 35516 KB Output is correct
11 Correct 229 ms 38588 KB Output is correct
12 Correct 272 ms 34676 KB Output is correct
13 Correct 155 ms 35516 KB Output is correct
14 Correct 152 ms 35808 KB Output is correct
15 Correct 141 ms 35772 KB Output is correct
16 Correct 127 ms 35960 KB Output is correct
17 Correct 28 ms 5736 KB Output is correct
18 Correct 55 ms 8264 KB Output is correct
19 Correct 113 ms 37316 KB Output is correct
20 Correct 78 ms 34156 KB Output is correct
21 Correct 75 ms 34232 KB Output is correct
22 Correct 225 ms 37828 KB Output is correct
23 Correct 213 ms 38588 KB Output is correct
24 Correct 144 ms 36796 KB Output is correct
25 Correct 152 ms 37024 KB Output is correct
26 Correct 135 ms 36800 KB Output is correct
27 Correct 124 ms 36584 KB Output is correct
28 Correct 28 ms 5460 KB Output is correct
29 Correct 27 ms 5880 KB Output is correct
30 Correct 25 ms 5712 KB Output is correct
31 Correct 110 ms 35800 KB Output is correct
32 Correct 121 ms 38080 KB Output is correct
33 Correct 2 ms 592 KB Output is correct
34 Correct 2 ms 592 KB Output is correct
35 Correct 2 ms 592 KB Output is correct
36 Correct 2 ms 592 KB Output is correct
37 Correct 2 ms 592 KB Output is correct
38 Correct 2 ms 848 KB Output is correct
39 Correct 2 ms 760 KB Output is correct
40 Correct 2 ms 592 KB Output is correct
41 Correct 2 ms 336 KB Output is correct
42 Correct 1 ms 508 KB Output is correct
43 Correct 1 ms 336 KB Output is correct
44 Correct 2 ms 592 KB Output is correct
45 Correct 2 ms 592 KB Output is correct
46 Correct 1 ms 336 KB Output is correct
47 Correct 3 ms 592 KB Output is correct
48 Correct 2 ms 592 KB Output is correct
49 Correct 2 ms 592 KB Output is correct
50 Correct 1 ms 336 KB Output is correct
51 Correct 2 ms 764 KB Output is correct
52 Correct 123 ms 37272 KB Output is correct
53 Correct 81 ms 34092 KB Output is correct
54 Correct 80 ms 34232 KB Output is correct
55 Correct 195 ms 37840 KB Output is correct
56 Correct 250 ms 38640 KB Output is correct
57 Correct 167 ms 36796 KB Output is correct
58 Correct 151 ms 37048 KB Output is correct
59 Correct 132 ms 36800 KB Output is correct
60 Correct 31 ms 5960 KB Output is correct
61 Correct 32 ms 5700 KB Output is correct
62 Correct 26 ms 5724 KB Output is correct
63 Correct 112 ms 35836 KB Output is correct
64 Correct 114 ms 36968 KB Output is correct
65 Correct 29 ms 6216 KB Output is correct
66 Correct 237 ms 35772 KB Output is correct
67 Correct 157 ms 37264 KB Output is correct
68 Correct 147 ms 35772 KB Output is correct
69 Correct 31 ms 5704 KB Output is correct
70 Correct 81 ms 16976 KB Output is correct