# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1005494 | vjudge1 | 무제 (POI11_imp) | C++17 | 476 ms | 1872 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
//
// main.cpp
// IntensiveCamp 2 2024
//
// Created by Ali AlSalman on 17/05/2024.
//
#include <bits/stdc++.h>
#define endl '\n'
using namespace std;
int main() {
ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
int n, m;
cin>>n>>m;
set<int> nodes; for (int i = 1; i <= n; i++) nodes.insert(i);
vector<vector<bool>> con(n + 1, vector<bool>(n + 1));
while (m--) {
int a, b;
cin>>a>>b;
con[a][b] = con[b][a] = true;
}
for (int i = 1; i <= n; i++) for (int j = i + 1; j <= n; j++) {
if (nodes.find(i) != nodes.end() && nodes.find(j) != nodes.end() &&
!con[i][j]) { nodes.erase(i); nodes.erase(j); }
}
int reqRes = n / 3;
for (auto node = nodes.begin(); reqRes--; node++) cout<<*node<<" "; cout<<endl;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |