# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
110996 | The_Wolfpack | Cave (IOI13_cave) | C++14 | 10 ms | 896 KiB |
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 ans[5006];
int tmp[5006];
int doors[5006];
void exploreCave(int N)
{
memset(ans,sizeof(ans),-1);
for(int i=0;i<N;i++)
{
for(int i1=0;i1<5005;i1++) tmp[i1]=0;
for(int j=0;j<N;j++) if(ans[j]!=-1) tmp[j]=ans[j];
int sta=0;
if(tryCombination(tmp)==i) sta=1;
int koji;
int L=0;
int R=N-1;
while(L!=R)
{
int mid=(L+R)/2;
for(int j=L;j<=mid;j++) tmp[j]=sta;
for(int j=mid+1;j<=R;j++) tmp[j]=1-sta;
for(int j=0;j<N;j++) if(ans[j]!=-1) tmp[j]=ans[j];
if(tryCombination(tmp)==i) L=mid+1;
else{R=mid;}
}
doors[L]=i;
ans[L]=sta;
}
answer(ans,doors);
}
Compilation message (stderr)
# | 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... |