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 "cave.h"
#include <bits/stdc++.h>
using namespace std;
int n,s[5000],d[5000];
void getd(){
for(int i = 0; i < 5000; ++i){
s[i] = 1-s[i];
int dor = tryCombination(s);
d[i] = dor, s[i] = 1-s[i];
}
}
void exploreCave(int N){
n = N;
bool fl = 0;
for(int i = 0; i < 5000; ++i)
s[i] = 0;
for(int i = 0; i < 5000; ++i){
int dor = tryCombination(s);
if(dor == -1){
fl = 1;
break;
}
int l = 0, r = n;
while(r-l > 1){
int md = (l+r)>>1;
for(int j = l; j < md; ++j)
s[j] = 1-s[j];
int ndor = tryCombination(s);
if(dor == ndor)
l = md;
else{
r = md;
for(int j = l; j < md; ++j)
s[j] = 1-s[j];
}
}
d[l] = dor, s[l] = 1-s[l];
}
if(fl){
getd();
}
answer(s,d);
return;
}
// int main(){
// return 0;
// }
# | 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... |