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 <iostream>
#define pb push_back
using namespace std;
const int N = 5005;
int s[N],d[N];
bool f[N];
void exploreCave(int N) {
int ans=0;
for (int i = 0; i < N; i++){
if (ans == N) break;
int x = tryCombination(s);
if (x == -1) x = 1e9;
for (int j = 0; j < N; j++){
if (f[j]) continue;
s[j] = 1;
int x2 = tryCombination(s);
if (x2==-1) x2=1e9;
if (x2 != x) {
f[j] = 1;
ans++;
d[j] = min(x2,x);
if (x2 < x) {
s[j] = 0;
}
else {
x = x2;
s[j] = 1;
}
continue;
}
s[j] = 0;
}
}
answer(s,d);
}
# | 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... |