#include <bits/stdc++.h>
#include "sphinx.h"
using namespace std;
vector<int> find_colours(int N, vector<int> X, vector<int> Y) {
vector<int> color(N, -1);
vector<vector<int>> groups;
for (int v = 0; v < N; ++v) {
bool found = false;
for (int g = 0; g < groups.size(); ++g) {
vector<int> E(N, -1);
for (int u : groups[g])
E[u] = 0;
E[v] = 0;
int result = perform_experiment(E);
if (result == 1) {
color[v] = g;
groups[g].push_back(v);
found = true;
break;
}
}
if (!found) {
color[v] = groups.size();
groups.push_back({v});
}
}
return color;
}
# | 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... |