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;
#define all(x) x.begin(), x.end()
#define mp make_pair
#define mt make_tuple
#define x first
#define y second
const int N = 5050;
int s[N];
int d[N];
int query() {
return tryCombination(s);
}
void exploreCave(int n) {
int cur = query();
while (cur != -1) {
for (int i = 0; i < n; ++i) {
s[i] ^= 1;
int now = query();
if (cur < now || now == -1) {
// d[i] = cur;
cur = now;
break;
} else {
s[i] ^= 1;
}
}
}
for (int i = 0; i < n; ++i) {
s[i] ^= 1;
int tmp = query();
s[i] ^= 1;
assert(tmp != -1);
d[i] = tmp;
}
answer(s, d);
}
#ifdef LC
#include "graderlib.c"
int main() {
N = init();
exploreCave(N);
printf("INCORRECT\nYour solution did not call answer().\n");
return 0;
}
#endif
# | 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... |