#include "island.h"
#include <bits/stdc++.h>
const int MAX_N = 300;
int depth[MAX_N + 1];
bool isCand[MAX_N + 1];
using namespace std;
void solve(int n, int l) {
int root = 1;
depth[root] = 0;
queue<int> cand;
cand.push(root);
isCand[root] = true;
for (int i = 1; i <= n - 1; i++) {
int v = query(root, i);
int j = 1;
int p = query(v, j);
while (!isCand[p]) {
j++;
p = query(v, j);
}
answer(p, v);
depth[v] = depth[p] + 1;
cand.push(v);
isCand[v] = true;
while (depth[cand.front()] + 1 < depth[v]) {
isCand[cand.front()] = false;
cand.pop();
}
}
}
# | 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... |