이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "cave.h"
#include <bits/stdc++.h>
using namespace std;
void exploreCave(int N) {
vector<int> S(N, 0), D(N, -1);
for (int i = 0; i < N; ++i)
{
int remplacer=1;
int tryc=tryCombination(S.data());
if (tryc>i || tryc==-1) {
for (int j = 0; j < N; ++j)
{
if (D[j]==-1)
{
S[j]=1;
}
}
remplacer=0;
}
vector<int> s_new=S;
int l=0, r=N-1;
while(l<r) {
int mid=(l+r)/2;
for (int j = l; j <= mid; ++j)
{
if (D[j]==-1)
{
s_new[j]=remplacer;
}
}
int tryc=tryCombination(s_new.data());
if (tryc>i || tryc==-1) {
r=mid;
}
else {
l=mid+1;
}
s_new=S;
}
S[l]=remplacer;
D[l]=i;
for (int j = 0; j < N; ++j)
{
if (D[j]==-1)
{
S[j]=0;
}
}
}
answer(S.data(), D.data());
}
# | 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... |