Submission #293541

#TimeUsernameProblemLanguageResultExecution timeMemory
293541DovranHighway Tolls (IOI18_highway)C++17
0 / 100
21 ms5504 KiB
#include <bits/stdc++.h> #include "highway.h" #define N 200009 #define pii pair <int, int> #define ff first #define ss second #define pb push_back #define ll long long using namespace std; ll n, m, dsa=0, vis[N]; vector<int>e[N]; ll x; void f(int nd, int pr, int lv){ if(lv==x){ dsa=1; answer(0, nd); return; } for(auto i:e[nd]){ if(i!=pr and lv<x) f(i, nd, lv+1); if(dsa) return; } } void find_pair(int NN, std::vector<int>u, std::vector<int>v, int a, int b){ 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); } x=ask(asd); x/=a; f(0, 0, 0); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...