#include "swap.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> w1;
vector<pair<int,int>> w2;
void init(int N, int M,
std::vector<int> U, std::vector<int> V, std::vector<int> W) {
w1.resize(N);
w1[0] = 0;
for(int i = 0; i < M; i++){
w1[V[i]] = W[i];
}
for(int i = 0; i < M; i++){
w2.push_back({W[i], V[i]});
}
sort(w2.begin(), w2.end());
}
int getMinimumFuelCapacity(int X, int Y) {
int mx = 0;
if(X != 0) mx = max(mx, w1[X]);
if(Y != 0) mx = max(mx, w1[Y]);
int i = 0;
if(X == w2[i].second || Y == w2[i].second)i++;
if(X == w2[i].second || Y == w2[i].second)i++;
return max(mx, w2[i].first);
}
/*
4 3
0 1 1
0 2 2
0 3 3
4
1 2
1 3
0 1
3 0
*/
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |