# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1092402 | Luvidi | Coreputer (IOI23_coreputer) | C++17 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
std::vector<int> malfunctioning_cores(int n) {
int idx,s;
vector<int> v;
for(int i=0;i<n;i++){
v.push_back(i);
int x=run_diagnostic(v);
if(x!=-1){
s=x;
idx=i;
break;
}
}
vector<int> ans(n);
if(s){
v.pop_back();
for(int i=idx;i<n;i++){
v.push_back(i);
ans[i]=run_diagnostic(v)==1;
v.pop_back();
}
v.clear();
for(int i=idx+1;i<n;i++)v.push_back(i);
for(int i=0;i<idx;i++){
v.push_back(i);
ans[i]=run_diagnostic(v)==1;
v.pop_back();
}
}else{
for(int i=idx+1;i<n;i++){
v.push_back(i);
ans[i]=run_diagnostic(v)==1;
v.pop_back();
}
v.clear();
for(int i=idx+1;i<n;i++)v.push_back(i);
for(int i=0;i<=idx;i++){
v.push_back(i);
ans[i]=run_diagnostic(v)==1;
v.pop_back();
}
}
return ans;
}