#include "sphinx.h"
#include<bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i=a;i<b;i++)
#define trav(a,v) for(auto a:v)
typedef long long int lld;
vector<int> ans;
int n;
void solve(int a, int b, vector<int> poss){
vector<int> nx;
int expN=-1;
if(true){
vector<int> V2;
rep(i,0,n){
if(a<=i && i<=b)V2.push_back(-1);
else V2.push_back(n);
}
expN=perform_experiment(V2);
}
// cout<<a<<" "<<b<<" "<<expN<<endl;
trav(x,poss){
vector<int> V2;
rep(i,0,n){
if(a<=i && i<=b)V2.push_back(-1);
else V2.push_back(x);
}
int U=perform_experiment(V2);
// cout<<U<<" "<<expN<<" "<<x<<endl;
if(U<expN)nx.push_back(x);
}
if(a==b){
ans[a]=nx[0];
return;
}
int mid=(a+b)/2;
solve(a,mid,nx);
solve(mid+1,b,nx);
}
std::vector<int> find_colours(int N, std::vector<int> X, std::vector<int> Y) {
n=N;
ans.resize(n,0);
vector<int> V;
rep(i,0,n)V.push_back(i);
int mid=(n-1)/2;
solve(0,mid,V);
solve(mid+1,n-1,V);
// std::vector<int> E(N, -1);
// int x = perform_experiment(E);
// std::vector<int> G(N, 0);
// if (x == 1)
// G[0] = 1;
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
336 KB |
#experiments: 20 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
336 KB |
#experiments: 6 |
2 |
Correct |
1 ms |
336 KB |
#experiments: 6 |
3 |
Correct |
1 ms |
336 KB |
#experiments: 6 |
4 |
Correct |
1 ms |
336 KB |
#experiments: 6 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
336 KB |
#experiments: 20 |
2 |
Correct |
1 ms |
336 KB |
#experiments: 6 |
3 |
Correct |
1 ms |
336 KB |
#experiments: 6 |
4 |
Correct |
1 ms |
336 KB |
#experiments: 6 |
5 |
Correct |
1 ms |
336 KB |
#experiments: 6 |
6 |
Correct |
7 ms |
336 KB |
#experiments: 294 |
7 |
Runtime error |
2 ms |
336 KB |
Execution killed with signal 11 |
8 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
336 KB |
#experiments: 6 |
2 |
Correct |
1 ms |
336 KB |
#experiments: 6 |
3 |
Correct |
1 ms |
336 KB |
#experiments: 6 |
4 |
Correct |
1 ms |
336 KB |
#experiments: 6 |
5 |
Correct |
7 ms |
336 KB |
#experiments: 294 |
6 |
Runtime error |
2 ms |
336 KB |
Execution killed with signal 11 |
7 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
336 KB |
#experiments: 6 |
2 |
Correct |
1 ms |
336 KB |
#experiments: 6 |
3 |
Correct |
1 ms |
336 KB |
#experiments: 6 |
4 |
Correct |
1 ms |
336 KB |
#experiments: 6 |
5 |
Correct |
6 ms |
336 KB |
#experiments: 294 |
6 |
Correct |
9 ms |
336 KB |
#experiments: 452 |
7 |
Correct |
11 ms |
504 KB |
#experiments: 470 |
8 |
Correct |
11 ms |
336 KB |
#experiments: 526 |
9 |
Correct |
12 ms |
336 KB |
#experiments: 580 |
10 |
Correct |
14 ms |
336 KB |
#experiments: 598 |
11 |
Correct |
12 ms |
504 KB |
#experiments: 638 |
12 |
Correct |
14 ms |
336 KB |
#experiments: 670 |
13 |
Correct |
72 ms |
848 KB |
#experiments: 1820 |
14 |
Correct |
93 ms |
848 KB |
#experiments: 2498 |
15 |
Incorrect |
99 ms |
924 KB |
#experiments reached 2751 |
16 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
336 KB |
#experiments: 20 |
2 |
Correct |
1 ms |
336 KB |
#experiments: 6 |
3 |
Correct |
1 ms |
336 KB |
#experiments: 6 |
4 |
Correct |
1 ms |
336 KB |
#experiments: 6 |
5 |
Correct |
1 ms |
336 KB |
#experiments: 6 |
6 |
Correct |
7 ms |
336 KB |
#experiments: 294 |
7 |
Runtime error |
2 ms |
336 KB |
Execution killed with signal 11 |
8 |
Halted |
0 ms |
0 KB |
- |