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 <bits/stdc++.h>
// #include "graderlib.cpp"
#include "cave.h"
using namespace std;
const int mxN = 5005;
void exploreCave(int n) {
int switches[n];
int pos[n];
fill(switches, switches+n, 0);
int j = 0, prev = tryCombination(switches);
while(true) {
switches[j] = !switches[j];
int first = tryCombination(switches);
if(first == -1) break;
if(prev < first)
switches[j] = !switches[j];
j++;
if(j == n)
j = 0;
}
for(int i = 0; i < n; i++) {
switches[i] = !switches[i];
int first = tryCombination(switches);
pos[i] = first;
switches[i] = !switches[i];
}
answer(switches, pos);
}
// int main() {
// int N = init();
// exploreCave(N);
// return 0;
// }
# | 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... |