#include "swap.h"
#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int maxWeight = 0;
int weightComing[N];
vector<pair<pair<int, int>, int> > edge;
bool f = true;
bool cmp(pair<pair<int, int>, int> a, pair<pair<int, int>, int> b) {
return a.second < b.second;
}
void init(int N, int M, vector<int> U, vector<int> V, vector<int> W) {
if(N <= 3)
f = false;
maxWeight = 0;
for(int i = 0; i < M; i++) {
edge.push_back(make_pair(make_pair(U[i], V[i]), W[i]));
}
sort(edge.begin(), edge.end(), cmp);
for(int i = 0; i < M; i++) {
weightComing[edge[i].first.second] = edge[i].second;
}
maxWeight = edge[2].second;
if(N == M)
f = true;
}
int getMinimumFuelCapacity(int X, int Y) {
if(f) {
return max(maxWeight, max(weightComing[X], weightComing[Y]));
}
return -1;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
4 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
108 ms |
7004 KB |
Output is correct |
4 |
Correct |
111 ms |
9436 KB |
Output is correct |
5 |
Correct |
116 ms |
9956 KB |
Output is correct |
6 |
Correct |
141 ms |
9296 KB |
Output is correct |
7 |
Correct |
114 ms |
9740 KB |
Output is correct |
8 |
Correct |
116 ms |
9380 KB |
Output is correct |
9 |
Correct |
113 ms |
9456 KB |
Output is correct |
10 |
Correct |
112 ms |
9464 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
4 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
4 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
4 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
4 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |