이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "cave.h"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int sw[5005], match[5005];
void exploreCave(int N) {
memset(match, -1, sizeof(match));
for(int i = 0; i < N; i++){
ll L = 0, R = N - 1;
bool f = (tryCombination(sw) == i);
while(L <= R){
ll m = (L + R) / 2;
for(int j = L; j <= m; j++){
if(match[j] == -1){
sw[j] = 1;
}
}
bool g = (tryCombination(sw) == i);
for(int j = L; j <= m; j++){
if(match[j] == -1){
sw[j] = 0;
}
}
if(f == g) L = m + 1;
else R = m - 1;
}
match[L] = i, sw[L] = f;
}
answer(sw, match);
}
# | 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... |