# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
909907 | PlayVoltz | Coreputer (IOI23_coreputer) | C++17 | 1 ms | 596 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.
#include "coreputer.h"
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
vector<int> malfunctioning_cores(int n){
vector<int> c(n, 0), vect;
int low=-1, high=n, end;
while (low+1<high){
int mid=(low+high)/2;
vect.clear();
for (int i=0; i<=mid; ++i)vect.pb(i);
int res=run_diagnostic(vect);
if (res>=0)high=mid, end=res;
else low=mid;
}
c[high]=1;
for (int i=0; i<high; ++i){
vect.clear();
for (int j=0; j<=high; ++j)if (i!=j)vect.pb(j);
if (run_diagnostic(vect)<0)c[i]=1;
}
if (end){
for (int i=high+1; i<n; ++i){
vect.clear();
for (int j=high; j<n; ++j)if (i!=j)vect.pb(j);
if (run_diagnostic(vect)<0)c[i]=1;
}
}
else{
for (int i=high+1; i<n; ++i){
vect.clear();
for (int j=high+1; j<n; ++j)if (i!=j)vect.pb(j);
if (run_diagnostic(vect)<0)c[i]=1;
}
}
return c;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |