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;
int c[5003],f[5003],a[5003],i,j,x,l,r,m,e;
void A(int L,int R){for(int o=L;o<=R;o++)if(f[o]==0)c[o]^=1;}
int T(int I){e=tryCombination(c);return e<=I&&e!=1;}
void exploreCave(int N){
memset(f,0,sizeof(f));
memset(a,0,sizeof(a));
memset(c,0,sizeof(c));
for(i=0;i<N;i++){
if(T(i))A(0,N-1);
l=0,r=N-1;
while(l<r){
m=(l+r)/2;
A(l,m);
e=T(i);
A(l,m);
if(e) r=m;
else l=m+1;
}
a[l]=i,f[l]=1;
}answer(c,a);
}
Compilation message (stderr)
cave.cpp: In function 'void exploreCave(int)':
cave.cpp:12:6: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
12 | if(T(i))A(0,N-1);
| ^~
cave.cpp:13:3: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
13 | l=0,r=N-1;
| ^
# | 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... |