# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
263191 | NicolaAbusaad2014 | Highway Tolls (IOI18_highway) | C++14 | 0 ms | 0 KiB |
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 "highway.h"
#include <bits/stdc++.h>
using namespace std;
map<long,long>m;
vector<long long>v;
void find_pair(int N, std::vector<int> U, std::vector<int> V, int A, int B) {
int M = U.size();
vector<int> w(M);
for (int i = 0; i < M; ++i) {
w[i] = 0;
}
long long mn=ask(w);
for (int j = 0; j < M; ++j) {
std::vector<int> w(M);
for (int i = 0; i < M; ++i) {
w[i] = 0;
if(i==j){
w[i]=1;
}
}
long long toll = ask(w);
if(toll>mn){
v.push_back(U[j]);
v.push_back(V[j]);
m[V[j]]++;
m[U[j]]++;
}
}
vector<int>ans;
for(long i=0;i<v.size();i++){
if(m[v[i]]==1){
ans.push_back(v[i]);
}
answer(ans[0], ans[1]);
}
int main()
{
return 0;
}