QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#559027 | #9241. Sphinx | Wawi | Compile Error | / | / | C++17 | 1.7kb | 2024-09-11 19:46:55 | 2024-09-11 19:46:56 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
/*
the current size
the current l and r
the current v
all should be done
*/
// int perform_experiment(vector<int> e){
// return e.size();
// }
vector<int> find_colours(int n, vector<int> x, vector<int> y){
vector<int> ans(n);
vector<int> e, reset(n, -1);
int sz = 1;
while(sz < n) sz*=2;
for(int i = 0; i < n;i++){
e = reset;
for(int j = 0; j < n;j++){
if(j != i) e[j] = j;
}
int x = perform_experiment(e);
if(x == n){
ans[i] = i;
continue;
}
queue<array<int,3>> q;
q.push({0, sz/2 - 1, sz/2});
while(q.size()){
auto [l,r,v] = q.front();
q.pop();
e = reset;
int curr = l;
for(int j = 0; j < n;j++){
if(j != i){
e[j] = curr;
if(curr != r) curr++;
}
}
x = perform_experiment(e);
int crs = v/2;
if(x != v){
if(l == r){
ans[i] = l + 1;
break;
}
q.push({r + 1, r + crs, crs});
} else{
if(l == r){
ans[i] = l;
break;
}
q.push({l, l + crs - 1, crs});
}
}
}
return ans;
}
// void solve(){
// }
// int main(){
// ios::sync_with_stdio(false);
// cin.tie(0);
// cout.tie(0);
// int t=1;
// cin >> t;
// while(t--) solve();
// return 0;
// }
Details
answer.code: In function ‘std::vector<int> find_colours(int, std::vector<int>, std::vector<int>)’: answer.code:27:17: error: ‘perform_experiment’ was not declared in this scope 27 | int x = perform_experiment(e); | ^~~~~~~~~~~~~~~~~~