# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
263156 | Basilhijaz | Highway Tolls (IOI18_highway) | C++11 | 142 ms | 7672 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;
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;
}
vector<vector<pair<int, int> > > adj(N);
for(int i = 0; i < M; i++){
adj[U[i]].push_back({V[i], i});
adj[V[i]].push_back({U[i], i});
}
long long curr = ask(w);
int where = 0;
bool ok = 1;
while(ok){
ok = 0;
for(int j = 0; j < adj[where].size(); j++){
w[adj[where][j].second] = 1;
long long last = ask(w);
if(last != curr){
where = adj[where][j].first;
ok = 1;
curr = last;
break;
}
}
}
answer(0, where);
}
Compilation message (stderr)
# | 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... |