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;
#define pb push_back
#define mp make_pair
const int MAX=1e5;
void exploreCave(int N)
{
/* ... */
vector<int> vec;
int cur,lol,shi[MAX],pos[MAX];
for(int A=0;A<N;A++)
{
shi[A]=0;
pos[A]=0;
vec.pb(A);
}
for(int A=0;A<N;A++)
{
cur=tryCombination(shi);
if(cur==-1)
{
for(auto B:vec)
{
shi[B]=1;
pos[B]=tryCombination(shi);
shi[B]=0;
}
answer(shi,pos);
return ;
}
for(auto B:vec)
{
shi[B]=1;
lol=tryCombination(shi);
if(lol>cur or lol==-1)
{
shi[B]=1;
pos[B]=cur;
vec.erase(lower_bound(vec.begin(),vec.end(),B));
break;
}
else if(lol<cur)
{
shi[B]=0;
pos[B]=lol;
vec.erase(lower_bound(vec.begin(),vec.end(),B));
break;
}
shi[B]=0;
}
}
answer(shi,pos);
return ;
}
# | 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... |