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"
using namespace std;
int s[5005];
int state[5005];
int now[5005];
int last[5005];
int mp[5005];
void exploreCave(int N) {
int xx = tryCombination(s);
if(xx != 0) now[0] = true;
else now[0] = false;
for(int i=0;i<N;i++)
{
int l = 0;
int r = N;
while(l<=r)
{
if(l == r)
{
int xx = tryCombination(s);
if(xx == l)
{
s[l] ^=1;
}
break;
}
int mid = (l+r)>>1;
for(int j=l;j<=mid;j++)
{
if(state[j] == false)s[j] ^= 1;
}
int xx = tryCombination(s);
bool flag = false;
if(xx != i)flag = true;
if(now[i] != flag)l = mid+1;
else r = mid;
now[i] = flag;
}
state[l] = true;
mp[i] = l;
}
answer(s,mp);
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... |