Submission #713825

#TimeUsernameProblemLanguageResultExecution timeMemory
713825LittleOrangeHighway Tolls (IOI18_highway)C++17
0 / 100
13 ms1232 KiB
#include "highway.h" #include<bits/stdc++.h> using namespace std; using ll = long long; struct line{ ll to,i; }; void find_pair(int N, std::vector<int> U, std::vector<int> V, int A, int B) { int M = U.size(); vector<vector<line>> con(N); for(ll i = 0;i<M;i++){ con[U[i]].push_back({V[i],i}); con[V[i]].push_back({U[i],i}); } if (M == N-1){ vector<int> w(M,0); ll total_dis = ask(w)/A; auto doask = [&](){ return (ask(w)-total_dis*A)/(B-A); }; if (N<=100){ vector<int> ans; for(int i = 0;i<N;i++){ for(line l : con[i]){ w[l.i] = 1; } if (doask()==1) ans.push_back(i+1); for(line l : con[i]){ w[l.i] = 0; } } answer(ans[0],ans[1]); } } }
#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...