Submission #1099462

#TimeUsernameProblemLanguageResultExecution timeMemory
1099462pokmui9909Povjerenstvo (COI22_povjerenstvo)C++17
100 / 100
217 ms44564 KiB
#include <bits/stdc++.h> using namespace std; using ll = long long; #define x first #define y second ll N, M, used[500005]; vector<ll> G[500005]; int main(){ cin.tie(0) -> sync_with_stdio(0); cin >> N >> M; for(ll i = 1; i <= M; i++){ ll u, v; cin >> u >> v; G[u].push_back(v); G[v].push_back(u); } vector<ll> R; for(ll i = 1; i <= N; i++){ if(used[i]) continue; for(auto v : G[i]){ used[v] = 1; } R.push_back(i); } cout << R.size() << '\n'; for(auto e : R){ cout << e << ' '; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...