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 <bits/stdc++.h>
#include"cave.h"
using namespace std;
void exploreCave(int n) {
int fixed[n];
memset(fixed,-1,sizeof(fixed));
int posi[n];
for (int i=0;i<n;i++){
int s[n];
memset(s,0,sizeof(s));
for (int j=0;j<n;j++){
if (fixed[j]!=-1) s[j]=fixed[j];
}
int ori=0;
if (tryCombination(s)!=i) ori=1;
int mini=0,maxi=n;
while (mini+1<maxi){
int middle=(mini+maxi)/2;
for (int j=0;j<n;j++){
s[j]=ori;
}
for (int j=mini;j<middle;j++){
s[j]=1-ori;
}
for (int j=0;j<n;j++){
if (fixed[j]!=-1){
s[j]=fixed[j];
}
}
if (tryCombination(s)!=i){
maxi=middle;
}
else {
mini=middle;
}
}
posi[mini]=i;
fixed[mini]=1-ori;
}
answer(fixed,posi);
}
# | 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... |