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 <bits/stdc++.h>
using namespace std;
void solve(int N,int L){
vector<vector<int>> adj(N+1);
function<bool(int,int,int)> reachable = [&](int x,int p,int tar){
if(x==tar)return true;
for(int&i:adj[x])if(i!=p)if(reachable(i,x,tar))return true;
return false;
};
for(int i=1;i<=N;i++){
for(int j=1;j<N;j++){
auto t = query(i,j);
if(t>=i)break;
if(reachable(i,-1,t))break;
adj[i].emplace_back(t);
adj[t].emplace_back(i);
answer(i,t);
}
}
}
# | 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... |