Submission #316957

#TimeUsernameProblemLanguageResultExecution timeMemory
316957thecodingwizardUntitled (POI11_imp)C++11
9 / 100
3091 ms37368 KiB
#include <bits/stdc++.h> using namespace std; #define pb push_back bool adj[3000][3000]; int deg[3000]; int main() { int n, m; cin >> n >> m; for (int i = 0; i < m; i++) { int a, b; cin >> a >> b; --a; --b; deg[a]++; deg[b]++; adj[a][b] = 1; adj[b][a] = 1; } vector<int> A; for (int i = 0; i < n; i++) { if (deg[i] >= n/3*2) { bool g = true; for (int x : A) { if (!adj[i][x]) g = false; } if (g) A.pb(i); } if ((int)A.size() == n/3) break; } for (int x : A) cout << x+1 << " "; cout << endl; 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...
#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...