이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "cave.h"
#include <bits/stdc++.h>
using namespace std;
void exploreCave(int N)
{
int S[N];
int D[N];
int K[N];
for (int i = 0; i < N; i++)
{
vector<bool>tinka(N, true);
for (int j = 0; j < i; j++)
{
tinka[K[j]] = false;
}
vector<int>antros;
for (int j = 0; j < N; j++)
if (tinka[j])
antros.push_back(j);
for (int j : antros)
S[j] = 0;
int t = 0;
if (tryCombination(S) == i)
t = 1;
while (antros.size() > 1)
{
vector<int>a1;
vector<int>a2;
for (int j : antros)
{
if (a1.size() < a2.size())
{
a1.push_back(j);
}
else
{
a2.push_back(j);
}
}
for (int j : a1)
{
S[j] = t;
}
for (int j : a2)
{
S[j] = 1 - t;
}
if (tryCombination(S) != i)
{
antros = a1;
for (int j : a2)
S[j] = t;
}
else
{
antros = a2;
for (int j : a1)
S[j] = t;
}
}
int k = antros[0];
D[k] = i;
K[i] = k;
S[k] = t;
}
answer(S, D);
}
# | 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... |