#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;
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |