이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "cave.h"
using namespace std;
void exploreCave(int N){
int st[N], nw[N], ga[N], sw[N];
vector<int> lf(N);
iota(lf.begin(), lf.end(), 0);
for(int i = 0; i < N; i++) {
int l = 0, r = lf.size() - 1;
while(l < r) {
int m = (l + r) >> 1;
copy(st, st + N, nw);
for(int j = l; j <= m; j++) nw[j] = !st[lf[j]];
if(tryCombination(nw) == i) r = m;
else l = m + 1;
}
ga[lf[l]] = i; sw[i] = lf[l];
lf.erase(lf.begin() + l);
}
for(int te = tryCombination(st); te != -1; te = tryCombination(st)) st[sw[te]] = 1;
answer(st, ga);
}
# | 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... |