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 <bits/stdc++.h>
#include "highway.h"
#define N 100009
#define pii pair <int, int>
#define ff first
#define ss second
#define pb push_back
#define ll long long
using namespace std;
int n, m, dsa, vis[N];
vector<int>e[N];
void f(int nd, int pr, int lv, int x){
vis[nd]=1;
if(lv==x){
dsa=1;
answer(0, nd);
return;
}
for(auto i:e[nd]){
if(i!=pr and !vis[i])
f(i, nd, lv+1, x);
if(dsa)
return;
}
}
void find_pair(int NN, std::vector<int>u, std::vector<int>v, int a, int b){
n=NN, m=u.size();
vector<int>asd;
for(int i=0; i<n-1; i++)
e[u[i]].pb(v[i]), e[v[i]].pb(u[i]), asd.pb(1);
int x;
x=ask(asd), x/=b;
f(0, 0, 0, x);
}
# | 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... |