# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1163348 | boclobanchat | Cave (IOI13_cave) | C++20 | 181 ms | 536 KiB |
#include"cave.h"
#include<bits/stdc++.h>
using namespace std;
int tryCombination(int S[]);
void exploreCave(int N)
{
int pos[N],A[N],ans[N];
bool ck[N];
for(int i=0;i<N;i++) ck[i]=true,pos[i]=0;
for(int i=0;i<N;i++)
{
int l=0,r=N-1,p=-1,pp,pf=tryCombination(pos);
if(pf==-1) pf=N+1;
while(p<N-1) p++,pos[p]^=ck[p];
int f=tryCombination(pos);
if(f==-1) f=N+1;
bool e=(pf<f);
while(l<=r)
{
int mid=(l+r)/2;
while(p<mid) p++,pos[p]^=ck[p];
while(p>mid) pos[p]^=ck[p],p--;
int res=tryCombination(pos);
if(res==-1) res=N+1;
if(e)
{
if(res!=pf) r=mid-1,pp=mid;
else l=mid+1;
}
else
# | 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... |