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"
void exploreCave(int N) {
/* ... */
int s[N];
int poz[N];
bool ok[N];
for(int i = 0; i < N; i++)
s[i] = 0, ok[i] = false, poz[i] = -1;
int cnt = 0;
while(cnt < N) {
for(int i = 0; i < N; i++)
if(ok[i] == false)
s[i] = 0;
int x;
//= tryCombination(s);
for(int i = 0; i < N; i++) {
/*cout << "OK : ";
for(int j = 0; j < N; j++)
cout << ok[j] << ' ';
cout << endl;
cout << "POZ : ";
for(int j = 0; j < N; j++)
cout << poz[j] << ' ';
cout << endl;*/
if(ok[i] == false) {
x = tryCombination(s);
if(x == -1)
x = N;
s[i] = 1;
int y = tryCombination(s);
if(y == -1)
y = N;
//cout << "TRY: " << y << endl;
if(y > x) {
ok[i] = true;
s[i] = 1;
poz[i] = x;
cnt++;
} else if(y < x) {
ok[i] = true;
s[i] = 0;
poz[i] = y;
cnt++;
}
//x = y;
}
}
}
answer(s, poz);
}
# | 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... |