# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
245728 | uacoder123 | Cave (IOI13_cave) | C++14 | 0 ms | 0 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;
void explorecave(int N)
{
int n=N;
int arr[n]={};
while(trycombination(arr))
{
int ix,x=trycombination(arr);
i=0;
ix=x;
while(ix==x)
{
arr[i]^=1;
int iix=trycombination(arr);
if(iix<=ix&&ix!=-1)
arr[i]^=1;
else
x=iix;
}
}
int d[n];
for(int i=0;i<n;++i)
{
arr[i]^=1;
d[i]=trycombination(arr);
arr[i]^=1;
}
answer(arr,d);
exit(0);
}