#include "island.h"
#include <bits/stdc++.h>
using namespace std;
void solve(int N, int L) {
vector<int> order;
for (int k = 1; k < N; k++)
order.push_back(query(1, k));
vector p(N + 1, -1);
p[1] = 1;
for (int v : order) {
for (int k = 1; p[v] == -1; k++) {
int u = query(v, k);
if (p[u] == -1) p[u] = v;
else p[v] = u;
}
}
for (int i = 2; i <= N; i++)
answer(i, p[i]);
}
# | 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... |