#include "swap.h"
#include <cassert>
#include <cstdio>
#include <string>
#include <vector>
#include <map>
#include <set>
using namespace std;
vector<pair<int, int>> g[200005];
pair<int, int> p[200005];
map<pair<int, int>, int> mp, pos;
set<pair<int, int>> st;
int x, y;
void init(int N, int M,
std::vector<int> U, std::vector<int> V, std::vector<int> W) {
x = N;
y = M;
for(int i = 0; i < M; i++){
int a = U[i] + 1, b = V[i] + 1, c = W[i] + 1;
g[a].push_back({b, c});
g[b].push_back({a, c});
mp[{a, b}] = c;
mp[{b, a}] = c;
pos[{a, b}] = i + 1;
pos[{b, a}] = i + 1;
st.insert({c, i + 1});
}
}
int getMinimumFuelCapacity(int X, int Y) {
X++;
Y++;
if(x - 1 == y) return -1;
else return st.rbegin()->first;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
5468 KB |
Output is correct |
2 |
Correct |
1 ms |
5468 KB |
Output is correct |
3 |
Correct |
1 ms |
5468 KB |
Output is correct |
4 |
Correct |
2 ms |
5724 KB |
Output is correct |
5 |
Correct |
2 ms |
5980 KB |
Output is correct |
6 |
Correct |
2 ms |
5980 KB |
Output is correct |
7 |
Correct |
2 ms |
5868 KB |
Output is correct |
8 |
Correct |
2 ms |
5980 KB |
Output is correct |
9 |
Correct |
244 ms |
33364 KB |
Output is correct |
10 |
Correct |
287 ms |
39252 KB |
Output is correct |
11 |
Correct |
289 ms |
38804 KB |
Output is correct |
12 |
Correct |
311 ms |
40784 KB |
Output is correct |
13 |
Correct |
293 ms |
40784 KB |
Output is correct |
14 |
Correct |
269 ms |
33360 KB |
Output is correct |
15 |
Correct |
317 ms |
41544 KB |
Output is correct |
16 |
Correct |
349 ms |
40556 KB |
Output is correct |
17 |
Correct |
336 ms |
42428 KB |
Output is correct |
18 |
Correct |
372 ms |
42820 KB |
Output is correct |
19 |
Incorrect |
56 ms |
14480 KB |
Output isn't correct |
20 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
5468 KB |
Output is correct |
2 |
Correct |
1 ms |
5468 KB |
Output is correct |
3 |
Incorrect |
266 ms |
41380 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
5468 KB |
Output is correct |
2 |
Correct |
1 ms |
5468 KB |
Output is correct |
3 |
Correct |
1 ms |
5468 KB |
Output is correct |
4 |
Correct |
2 ms |
5724 KB |
Output is correct |
5 |
Correct |
2 ms |
5980 KB |
Output is correct |
6 |
Correct |
2 ms |
5980 KB |
Output is correct |
7 |
Correct |
2 ms |
5868 KB |
Output is correct |
8 |
Correct |
2 ms |
5980 KB |
Output is correct |
9 |
Incorrect |
1 ms |
5468 KB |
Output isn't correct |
10 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
5468 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
5468 KB |
Output is correct |
2 |
Correct |
1 ms |
5468 KB |
Output is correct |
3 |
Correct |
1 ms |
5468 KB |
Output is correct |
4 |
Correct |
2 ms |
5724 KB |
Output is correct |
5 |
Correct |
2 ms |
5980 KB |
Output is correct |
6 |
Correct |
2 ms |
5980 KB |
Output is correct |
7 |
Correct |
2 ms |
5868 KB |
Output is correct |
8 |
Correct |
2 ms |
5980 KB |
Output is correct |
9 |
Correct |
244 ms |
33364 KB |
Output is correct |
10 |
Correct |
287 ms |
39252 KB |
Output is correct |
11 |
Correct |
289 ms |
38804 KB |
Output is correct |
12 |
Correct |
311 ms |
40784 KB |
Output is correct |
13 |
Correct |
293 ms |
40784 KB |
Output is correct |
14 |
Correct |
269 ms |
33360 KB |
Output is correct |
15 |
Correct |
317 ms |
41544 KB |
Output is correct |
16 |
Correct |
349 ms |
40556 KB |
Output is correct |
17 |
Correct |
336 ms |
42428 KB |
Output is correct |
18 |
Correct |
372 ms |
42820 KB |
Output is correct |
19 |
Incorrect |
266 ms |
41380 KB |
Output isn't correct |
20 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
5468 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |