#include"cave.h"
#include <bits/stdc++.h>
using namespace std;
typedef int ll;
typedef tuple<ll, ll, ll> plll;
typedef vector<plll> vplll;
typedef pair<ll, ll> pll;
typedef vector<ll> vll;
typedef vector<pll> vpll;
typedef vector<vector<pll>> vvpll;
typedef vector<vector<ll>> vvll;
typedef vector<bool> vb;
typedef vector<vector<bool>> vvb;
#define loop(i, s, e) for (ll i = (s); i < (e); ++i)
#define loopr(i, e, s) for (ll i = (e)-1; i >= (s); --i)
#define all(a) a.begin(), a.end()
const ll inf = 1e9 + 7;
void exploreCave(int n) {
ll s[n];
loop(i,0,n) {
s[i] = 0;
}
ll loc[n];
vb of_prev(n, false);
loop(i,0,n) {
loop(j,0,n) {
if (of_prev[j] == false) {
ll cop[n];
loop(c,0,n) cop[c] = s[c];
cop[j] = 1;
ll cs = tryCombination(s), ccop = tryCombination(cop);
if (cs==-1) cs = n;
if (ccop==-1) ccop = n;
if (cs==i) {// if 1 is coorect here - ccop
of_prev[j] = 1;
s[j] = 1;
loc[j] = i;
break;
}
if (ccop==i) {// if 0 is coorect here - cs
of_prev[j] = 1;
s[j] = 0;
loc[j] = i;
break;
}
}
}
}
answer(s, loc);
}
# | 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... |