제출 #713836

#제출 시각아이디문제언어결과실행 시간메모리
713836Astrayt통행료 (IOI18_highway)C++17
0 / 100
14 ms1056 KiB
#include "highway.h" #include <bits/stdc++.h> using namespace std; #define pb push_back void find_pair(int N, vector<int> U, vector<int> V, int A, int B) { int M = U.size(), d = B - A; vector<int> w(M, 0), adj[N]; for(int i = 0; i < M; ++i){ adj[U[i]].pb(i); adj[V[i]].pb(i); } int S = -1, T = -1; long long toll = ask(w); for(int i = 0; i < N; ++i){ for(auto id:adj[i]){ w[id] = 1; } long long cur = ask(w); if(cur - toll == d && S == -1){ S = i; }else if(cur - toll == d) T = i; for(auto id:adj[i]){ w[id] = 0; } } answer(S, T); }
#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...