#include <bits/stdc++.h>
#include "cave.h"
//#include "grader.c"
using namespace std;
void exploreCave(int n) {
int ans1[n], ans2[n];
for(int &i : ans1) i = 0;
for(int i = 0; i+1 < n; i ++ ) {
set<int> st[2];
for(int x = 0; x < 2; x ++ )
for(int y = 0; y < 2; y ++ ){
ans1[ i ] = x;
ans1[i+1] = y;
st[x].insert(tryCombination(ans1));
}
for(int x = 0; x < 2; x ++ ){
if(st[x].size() == 1)
ans2[i] = *st[x].begin();
else ans1[i] = x;
}
};
int la = 0;
for(int x = 0; x < 2; x ++ ){
ans1[n-1] = x;
int va = tryCombination(ans1);
if(va == -1) la = x;
else ans2[n-1] = va;
};
ans1[n-1] = la;
int ans3[n-1];
for(int i = 0; i < n; i ++ )ans3[i] = ans1[i];
for(int i = n-1; i >= 0; i -- ){
ans3[i] ^= 1;
ans2[i] = tryCombination(ans3);
}
answer(ans1, ans2);
};
# | 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... |