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 <bits/stdc++.h>
using namespace std;
vector <pair <int, int>> edge;
vector <int> weight;
void init (int N, int M, vector<int> U, vector<int> V, vector<int> W) {
weight.resize(N);
for (int i = 0; i < M; i ++) {
edge.push_back({W[i], V[i]});
weight[V[i]] = W[i];
}
sort(edge.begin(), edge.end());
}
int getMinimumFuelCapacity (int X, int Y) {
if (!X or !Y) {
return -1;
}
else {
int max_weight = max(weight[X], weight[Y]);
for (auto i: edge) {
if (i.second != X and i.second != Y) {
max_weight = max(max_weight, i.first);
break;
}
}
return max_weight;
}
}
# | 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... |