이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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=0, vis[N];
vector<int>e[N];
/*
void answer(int s, int t){
cout<<s<<' '<<t<<" sakjdfhlajkbhdlk \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]==0)
f(i, nd, lv+1, x);
if(dsa==1)
return;
}
}
/*
int ask(vector<int>asd){
for(auto i:asd)
cout<<i<<' ';
int qwe;
cin>>qwe;
return qwe;
}
*/
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<m; i++)
e[u[i]].pb(v[i]), e[v[i]].pb(u[i]), asd.pb(0);
int x;
x=ask(asd), x/=a;
f(0, 0, 0, x);
}
/*
int main(){
int a, b, c, d;
vector<int>u, v;
cin>>a>>b>>c>>d;
for(int i=1; i<=b; i++){
int x, y;
cin>>x>>y;
u.push_back(x);
v.push_back(y);
}
find_pair(b, u, v, c, d);
}*/
# | 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... |