#include "swap.h"
#include "bits/stdc++.h"
using namespace std;
#define pb push_back
#define ff first
#define ss second
#define sz(x) (int)x.size()
#define int long long
const int NN = 1e5+5;
int res;
vector<pair<int, int>> edges[NN];
void init(int32_t N, int32_t M,
vector<int32_t> U, vector<int32_t> V, vector<int32_t> W) {
//cout<<"\n";
int sum = 0, mx = 0;
for(int i=0;i<M;i++){
edges[U[i]].pb({V[i], W[i]});
edges[V[i]].pb({U[i], W[i]});
sum += W[i], mx = max(mx, (int)W[i]);
}
if(N == M) res = max(sum - mx, mx);
else res = -1;
}
/*
5 5
1 0 1
2 1 2
3 2 3
4 3 4
4 0 5
5
0 1
1 2
2 3
3 4
4 0
*/
int32_t getMinimumFuelCapacity(int32_t x, int32_t y) {
return res;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
2636 KB |
Output is correct |
2 |
Correct |
2 ms |
2636 KB |
Output is correct |
3 |
Correct |
2 ms |
2636 KB |
Output is correct |
4 |
Correct |
2 ms |
2636 KB |
Output is correct |
5 |
Correct |
3 ms |
2636 KB |
Output is correct |
6 |
Correct |
3 ms |
2636 KB |
Output is correct |
7 |
Correct |
3 ms |
2636 KB |
Output is correct |
8 |
Correct |
3 ms |
2636 KB |
Output is correct |
9 |
Correct |
48 ms |
8560 KB |
Output is correct |
10 |
Correct |
59 ms |
9924 KB |
Output is correct |
11 |
Correct |
62 ms |
9772 KB |
Output is correct |
12 |
Correct |
60 ms |
10092 KB |
Output is correct |
13 |
Correct |
61 ms |
10096 KB |
Output is correct |
14 |
Correct |
54 ms |
8644 KB |
Output is correct |
15 |
Correct |
141 ms |
11856 KB |
Output is correct |
16 |
Correct |
119 ms |
11604 KB |
Output is correct |
17 |
Correct |
127 ms |
11976 KB |
Output is correct |
18 |
Correct |
153 ms |
11984 KB |
Output is correct |
19 |
Incorrect |
75 ms |
7620 KB |
Output isn't correct |
20 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
2636 KB |
Output is correct |
2 |
Correct |
2 ms |
2636 KB |
Output is correct |
3 |
Incorrect |
106 ms |
10932 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
2636 KB |
Output is correct |
2 |
Correct |
2 ms |
2636 KB |
Output is correct |
3 |
Correct |
2 ms |
2636 KB |
Output is correct |
4 |
Correct |
2 ms |
2636 KB |
Output is correct |
5 |
Correct |
3 ms |
2636 KB |
Output is correct |
6 |
Correct |
3 ms |
2636 KB |
Output is correct |
7 |
Correct |
3 ms |
2636 KB |
Output is correct |
8 |
Correct |
3 ms |
2636 KB |
Output is correct |
9 |
Incorrect |
2 ms |
2636 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
2636 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
2636 KB |
Output is correct |
2 |
Correct |
2 ms |
2636 KB |
Output is correct |
3 |
Correct |
2 ms |
2636 KB |
Output is correct |
4 |
Correct |
2 ms |
2636 KB |
Output is correct |
5 |
Correct |
3 ms |
2636 KB |
Output is correct |
6 |
Correct |
3 ms |
2636 KB |
Output is correct |
7 |
Correct |
3 ms |
2636 KB |
Output is correct |
8 |
Correct |
3 ms |
2636 KB |
Output is correct |
9 |
Correct |
48 ms |
8560 KB |
Output is correct |
10 |
Correct |
59 ms |
9924 KB |
Output is correct |
11 |
Correct |
62 ms |
9772 KB |
Output is correct |
12 |
Correct |
60 ms |
10092 KB |
Output is correct |
13 |
Correct |
61 ms |
10096 KB |
Output is correct |
14 |
Correct |
54 ms |
8644 KB |
Output is correct |
15 |
Correct |
141 ms |
11856 KB |
Output is correct |
16 |
Correct |
119 ms |
11604 KB |
Output is correct |
17 |
Correct |
127 ms |
11976 KB |
Output is correct |
18 |
Correct |
153 ms |
11984 KB |
Output is correct |
19 |
Incorrect |
106 ms |
10932 KB |
Output isn't correct |
20 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
2636 KB |
Output isn't correct |