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>
#define test tryCombination
using namespace std;
void exploreCave(int N) {
int door[N],ans[N],vis[N];
memset(vis,0,sizeof vis);
for(int i=0;i<N;i++){
ans[i]=0;
door[i]=i;
}
int curr=test(ans);
// cout<<curr<<endl;
for(int i=0;i<N;i++){
if(curr==-1)break;
for(int j=0;j<N;j++){
if(vis[j]==1)continue;
ans[j]^=1;
int pos=test(ans);
if(pos<=curr){vis[j]=1;ans[i]^=1;}
if(pos>curr){vis[j]=1;}
}
}
reverse(ans,ans+N);
for(int i=0;i<N;i++){
ans[i]^=1;
int h=test(ans);
door[i]=h;
ans[i]^=1;
}
answer(ans,door);
}
# | 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... |