#include "swap.h"
#include <vector>
#include<bits/stdc++.h>
using namespace std;
#define L(i, j, k) for (int i = (j); i <= k; i++)
#define R(i, j, k) for (int i = (j); i >= k; i--)
const int nax = 100050;
int N, M;
int ok = true;
int mx = -1;
vector<pair<int, int>> G[nax];
void init(int _N, int _M, std::vector<int> _U, std::vector<int> _V, std::vector<int> _W) {
N = _N; M = _M;
for (int i = 0; i < M; i++) {
G[_U[i]].push_back(make_pair(_V[i], _W[i]));
G[_V[i]].push_back(make_pair(_U[i], _W[i]));
mx = max(mx, _W[i]);
}
for (int i = 0; i < N; i++)
if (G[i].size() <= 1)
ok = false;
}
int getMinimumFuelCapacity(int X, int Y) {
if (!ok) return -1;
return mx;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
2648 KB |
Output is correct |
2 |
Correct |
1 ms |
2652 KB |
Output is correct |
3 |
Correct |
1 ms |
2652 KB |
Output is correct |
4 |
Correct |
1 ms |
2744 KB |
Output is correct |
5 |
Correct |
1 ms |
2652 KB |
Output is correct |
6 |
Correct |
2 ms |
2652 KB |
Output is correct |
7 |
Correct |
2 ms |
2652 KB |
Output is correct |
8 |
Correct |
1 ms |
2660 KB |
Output is correct |
9 |
Correct |
26 ms |
7004 KB |
Output is correct |
10 |
Correct |
35 ms |
8028 KB |
Output is correct |
11 |
Correct |
31 ms |
7748 KB |
Output is correct |
12 |
Correct |
35 ms |
8044 KB |
Output is correct |
13 |
Correct |
33 ms |
8020 KB |
Output is correct |
14 |
Correct |
30 ms |
7004 KB |
Output is correct |
15 |
Correct |
73 ms |
9708 KB |
Output is correct |
16 |
Correct |
80 ms |
9728 KB |
Output is correct |
17 |
Correct |
73 ms |
9948 KB |
Output is correct |
18 |
Correct |
72 ms |
9988 KB |
Output is correct |
19 |
Correct |
41 ms |
6996 KB |
Output is correct |
20 |
Correct |
72 ms |
10964 KB |
Output is correct |
21 |
Correct |
73 ms |
11024 KB |
Output is correct |
22 |
Correct |
77 ms |
11452 KB |
Output is correct |
23 |
Correct |
77 ms |
11196 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
2648 KB |
Output is correct |
2 |
Correct |
1 ms |
2652 KB |
Output is correct |
3 |
Incorrect |
68 ms |
10348 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
2648 KB |
Output is correct |
2 |
Correct |
1 ms |
2652 KB |
Output is correct |
3 |
Correct |
1 ms |
2652 KB |
Output is correct |
4 |
Correct |
1 ms |
2744 KB |
Output is correct |
5 |
Correct |
1 ms |
2652 KB |
Output is correct |
6 |
Correct |
2 ms |
2652 KB |
Output is correct |
7 |
Correct |
2 ms |
2652 KB |
Output is correct |
8 |
Correct |
1 ms |
2660 KB |
Output is correct |
9 |
Incorrect |
1 ms |
2648 KB |
Output isn't correct |
10 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
2648 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
2648 KB |
Output is correct |
2 |
Correct |
1 ms |
2652 KB |
Output is correct |
3 |
Correct |
1 ms |
2652 KB |
Output is correct |
4 |
Correct |
1 ms |
2744 KB |
Output is correct |
5 |
Correct |
1 ms |
2652 KB |
Output is correct |
6 |
Correct |
2 ms |
2652 KB |
Output is correct |
7 |
Correct |
2 ms |
2652 KB |
Output is correct |
8 |
Correct |
1 ms |
2660 KB |
Output is correct |
9 |
Correct |
26 ms |
7004 KB |
Output is correct |
10 |
Correct |
35 ms |
8028 KB |
Output is correct |
11 |
Correct |
31 ms |
7748 KB |
Output is correct |
12 |
Correct |
35 ms |
8044 KB |
Output is correct |
13 |
Correct |
33 ms |
8020 KB |
Output is correct |
14 |
Correct |
30 ms |
7004 KB |
Output is correct |
15 |
Correct |
73 ms |
9708 KB |
Output is correct |
16 |
Correct |
80 ms |
9728 KB |
Output is correct |
17 |
Correct |
73 ms |
9948 KB |
Output is correct |
18 |
Correct |
72 ms |
9988 KB |
Output is correct |
19 |
Incorrect |
68 ms |
10348 KB |
Output isn't correct |
20 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
2648 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |