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 "graderlib.c"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define ull unsigned long long
#define pii pair<int, int>
#define pll pair<ll, ll>
#define fi first
#define se second
const int MAX_N = 5e3 + 5;
int a[MAX_N], b[MAX_N], input;
bool check[MAX_N];
void exploreCave(int N) {
int cnt = 0;
while (cnt < N) {
for (int i = 0; i < N; i++) if (!check[i]) a[i] = 0;
input = tryCombination(a);
int id;
if (input == -1 or input > cnt) id = 0;
else id = 1;
int l = 0, r = N - 1;
while (l < r) {
int len = 0, cnt2 = 0, m = -1;
for (int i = 0; i < N; i++) if (!check[i]) a[i] = 1 - id;
for (int i = l; i <= r; i++) if (!check[i]) len++;
for (int i = l; i <= r; i++) {
if (check[i]) continue;
cnt2++;
m = i;
a[i] = id;
if (cnt2 == len / 2) break;
}
if (len == 1) {
l = m;
break;
}
input = tryCombination(a);
if (input == -1 or input > cnt) r = m;
else l = m + 1;
}
check[l] = 1, a[l] = id, b[l] = cnt;
cnt++;
}
answer(a, b);
}
// int main() {
// int N;
// N = init();
// exploreCave(N);
// printf("INCORRECT\nYour solution did not call answer().\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... |