#include <bits/stdc++.h>
#include "cave.h"
using namespace std;
int n, door[1000000], sw[100000], l , r, mid, ans[100000], first, second;
void exploreCave(int n) {
for (int x = 0; x < n; x++) {
first = tryCombination(door);
l = 0, r = n-1;
while (l != r) {
mid = (l+r)/2;
for (int i = l; i <= r; i++) if (!ans[i]) door[i] ^= 1;
second = tryCombination(door);
for (int i = l; i <= r; i++) if (!ans[i]) door[i] ^= 1;
if (first == second) l = mid+1;
else r = mid;
}
ans[l]++;
sw[l] = x;
if (first <= x || first != -1) door[l] = 1;
}
answer(sw, door);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
58 ms |
516 KB |
Answer is wrong |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
86 ms |
516 KB |
Answer is wrong |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
5 ms |
512 KB |
Answer is wrong |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
5 ms |
512 KB |
Answer is wrong |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
58 ms |
516 KB |
Answer is wrong |
2 |
Halted |
0 ms |
0 KB |
- |