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 S[5005], D[5005], st[5005];
vector<int> u;
void exploreCave(int N){
for(int i=0;i<N;i++){
int t=tryCombination(S);
bool open=false;
if(t==i)open=true; // se otvara so drugoto
int l=-1,r=N-1;
while(r-l>1){
int m=(l+r)/2;
for(int j=0;j<N;j++){
st[j]=(j<=m?open:!open);
}
for(int x:u){
st[x]=S[x];
}
int h=tryCombination(st);
if(h==i)
l=m;
else
r=m;
}
D[l+1]=i;
S[l+1]=open;
u.push_back(l+1);
}
answer(S,D);
}
# | 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... |