#include "cave.h"
const int SZ = 5010;
int s[SZ];
int d[SZ];
void exploreCave(int N) {
for(int i = 0; i < N; ++i){
s[i] = 1;
}
int v = tryCombination(s);
while(v != -1){
int l = 0, r = N - 1;
while(l <= r){
if(l == r) break;
int mid = (l + r) >> 1;
for(int i = l; i <= mid; ++i){
s[i] ^= 1;
}
int t = tryCombination(s);
for(int i = l; i <= mid; ++i){
s[i] ^= 1;
}
if(t > v) r = mid - 1;
else l = mid + 1;
}
s[l] ^= 1;
v = tryCombination(s);
} for(int i = 0; i < N; ++i){
s[i] ^= 1;
d[i] = tryCombination(s);
s[i] ^= 1;
}
answer(s, d);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
19 ms |
348 KB |
too much calls on tryCombination() |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
24 ms |
516 KB |
too much calls on tryCombination() |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Incorrect |
1 ms |
348 KB |
too much calls on tryCombination() |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Incorrect |
1 ms |
348 KB |
too much calls on tryCombination() |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
19 ms |
348 KB |
too much calls on tryCombination() |
2 |
Halted |
0 ms |
0 KB |
- |