#include "sphinx.h"
#include <bits/stdc++.h>
using namespace std;
#define NL "\n"
#define EL cout << NL
#define FOR(i,n) for (long long i = 0; i < (n); i++)
#define FORS(i,s,n) for (long long i = (s); i < (n); i++)
#define FORR(i,n) for (long long i = (n)-1; i >= 0; i--)
#define PRINTV(v) for (auto a: v) {cout << a << " ";} EL;
#define PRINTVV(v) for (auto a: v) {PRINTV(a);}
#define f first
#define s second
#define all(v) (v).begin(),(v).end()
typedef vector<int> vi;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<ll,ll> pl;
typedef vector<pl> vpl;
typedef vector<vpl> vvpl;
std::vector<int> find_colours(int n, std::vector<int> x, std::vector<int> y) {
vector<int> ans(n);
FOR(u,n) {
// number of colors
ll l = 0;
ll r = n;
while (l+1 < r) {
ll m = (l+r)/2;
vi e(n,n);
e[u] = -1;
ll c = 0;
FOR(i,n) {
if (i == u) continue;
if (c >= m) break;
e[i] = c;
c++;
}
ll res = perform_experiment(e);
ll tot = m+1;
if (m == n-1) tot--;
if (res == tot) r = m;
else l = m;
}
ans[u] = l;
}
return ans;
}
# | 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... |