# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
869068 | AtabayRajabli | Cave (IOI13_cave) | C++17 | 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"
long int a[5001], ans[5001], d[5001];
void exploreCave(int n) {
int q = 0;
for(int i = 0; i<n; i++)
{
a[i] = 0;
ans[i] = 0;
d[i] = 0;
}
int j = 0;
while(j < n)
{
int q = tryCombination(a);
for(; j<q; j++)
{
ans[j] = a[j];
d[j] = j;
}
if(j < n)a[j] ^= 1;
}
answer(ans, d);
}