This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "island.h"
#include <vector>
void solve(int n, int L)
{
std::vector <int> order(n);
std::vector <bool> foundParent(n + 1, false);
for (int i = 1 ; i < n ; ++i)
{
order[i] = query(1, i);
}
foundParent[1] = true;
for (int i = 1 ; i < n ; ++i)
{
if (!foundParent[order[i]])
{
for (int idx = 1 ; idx < n ; ++idx)
{
int curr = query(order[i], idx);
answer(order[i], curr);
if (foundParent[curr])
{
foundParent[order[i]] = true;
break;
}
foundParent[curr] = true;
}
}
}
}
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |