#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "C:\debug.h"
#else
#define debug(...) 42
#endif
#include "island.h"
void solve(int n, int l) {
vector<int> pos, ord(n + 1);
for (int i = 1; i < n; ++i) {
pos.push_back(query(1, i));
ord[pos.back()] = i;
}
vector<bool> has_parent(n + 1);
for (int u : pos) {
if (has_parent[u]) continue;
for (int i = 1; i < n; ++i) {
int v = query(u, i);
answer(u, v);
if (ord[v] < ord[u]) break;
has_parent[v] = 1;
}
}
}
# | 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... |