# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
555284 | urosk | Cave (IOI13_cave) | C++14 | 0 ms | 0 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.
#define maxn 5005
ll n;
ll a[maxn];
ll b[maxn];
ll c[maxn];
void exploreCave(int N) {
n = N;
for(ll i = 0;i<n;i++) b[i] = -1;
for(ll i = 0;i<n;i++) c[i] = 0;
if(tryCombination(c)==-1){
for(ll i = 0;i<n;i++) c[i] = 1;
for(ll i = 0;i<n;i++){
ceri(b,0,n-1);
for(ll j = 0;j<n;j++){
if(b[j]!=-1) continue;
c[j] = 0;
ll e = tryCombination(c);
//ceri(c,0,n-1);
//cerr<<j<< " "<<e<<endl;
if(i==n-1){
if(e==-1){
b[j] = i;
answer(a,b);
}
}else{
if(e>i){
b[j] = i;
goto lol;
}
}
c[j] = 1;
}
lol:;
}
}
}