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>
int S[5050];
int s[5050];
int con[5050];
void exploreCave(int N) {
/* ... */
int n = N;
for(int i=0;i<n;i++)S[i]=-1;
int d=0;
//tem ini caras que comecam com 0;
int cur = 0;
while(d<n){
for(int i=0;i<n;i++){
if(S[i]!=-1)s[i]=S[i];
else s[i] = 0;
}
int ini = tryCombination(s);
while(cur<ini){
for(int i=0;i<n;i++){
if(S[i]!=-1)s[i] = S[i];
else s[i] = 0;
}
for(int i=0;i<n;i++){
s[i]=1;
int x = tryCombination(s);
if(x==cur){
con[cur] = i;
S[i] = 0;
d++;
break;
}
s[i] = 0;
}
}
//acho o 1
if(cur!=n){
for(int i=0;i<n;i++){
if(S[i]!=-1)s[i] = S[i];
else s[i] = 0;
}
for(int i=0;i<n;i++){
s[i]=1;
int x = tryCombination(s);
if(x>cur){
con[cur] = i;
S[i] = 1;
d++;
break;
}
s[i] = 0;
}
}
}
answer(S,con);
}
# | 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... |