#include "bits/stdc++.h"
#include "swap.h"
using namespace std;
const int NN=100005;
int len[NN];
vector<int> vals;
void init(int N, int M, std::vector<int> U, std::vector<int> V, std::vector<int> W) {
for(int i=0; i<M; i++){
int v = V[i];
len[v] = W[i];
vals.push_back(len[v]);
}
sort(vals.begin(),vals.end());
}
int getMinimumFuelCapacity(int X, int Y) {
int mx = max(len[X],len[Y]);
if(vals.size()==2) return -1;
if(vals[0]==len[X]&&vals[1]==len[Y]){
mx = vals[2];
}
if(vals[0]==len[Y]&&vals[1]==len[X]){
mx = vals[2];
}
return mx;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
364 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
364 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
364 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
364 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
364 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
364 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |