#include "sphinx.h"
#include <bits/stdc++.h>
using namespace std;
#define arr array
#define vec vector
int n;
int qry(int u = -1) {
vec<int> x(n, -1);
if (u != -1) x[u] = n;
return perform_experiment(x);
}
vec<int> find_colours(int _n, vec<int> _u, vec<int> _v) {
n = _n;
vec<int> cl(n, -1);
int x = qry();
cl[0] = 0;
for (int u = 0; u < n - 1; u++) {
int y = qry(u);
if (u == 0) {
if (y - x == 1) cl[u + 1] = cl[u];
else cl[u + 1] = !cl[u];
} else if (cl[u - 1] == cl[u]) {
if (y - x == 2) cl[u + 1] = cl[u];
else cl[u + 1] = !cl[u];
} else {
if (y - x == 1) cl[u + 1] = cl[u];
else cl[u + 1] = !cl[u];
}
}
return cl;
}
# | 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... |