#include "sphinx.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define str string
#define vd void
#define vb vector<bool>
#define F first
#define S second
#define lbr '\n'
#define all(x) x.begin(), x.end()
const ll INF = 1E15;
vi find_colours(int n, vi x, vi y) {
vi res(n, 0), vc(n, n), a(n, 0);
vll cant(n, 0);
vb h(n, 1);
ll m = x.size();
for (int i=0; i<m; i++) {
a[x[i]] = y[i];
cant[x[i]]++;
a[y[i]] = x[i];
cant[y[i]]++;
}
for (int i=0; i<n; i++) {
h[i] = !(cant[i] <= 1);
}
for (int i=0; i<n; i++) {
ll gav;
vc[a[i]]=0;
vc[i]=1;
gav = perform_experiment(vc);
gav--;
vc[i]=-1;
for (int j=0; j<n; j++) {
vc[a[i]] = j;
ll aux = perform_experiment(vc);
if (aux == gav) {
res[i] = j;
vc[a[i]]=n;
break;
}
}
vc[i]=n;
}
return res;
}
| # | 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... |