#include <bits/stdc++.h>
using namespace std;
const int M = 1e5+5;
vector<pair<int, int>> node[M];
vector<array<int, 3>> E;
int n, m;
int mx = 0, cycle = 3;
void init(int _n, int _m, vector<int> U, vector<int> V, vector<int> W) {
n = _n, m = _m;
for (int i = 0; i < m; i++) E.push_back({U[i], V[i], W[i]});
for (auto [a, b, c]:E)
node[a].push_back({b, c}),
node[b].push_back({a, c});
for (int i = 0; i < n; i++) cycle = min(cycle, (int)node[i].size());
for (auto [a, b, c]:E) mx = max(mx, c);
cycle = cycle > 1;
}
int getMinimumFuelCapacity(int X, int Y) {
// int x = solve(X, Y);
// if (x > 1e9) return -1;
// return x+1;
if (cycle) return mx;
return -1;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
2644 KB |
Output is correct |
2 |
Correct |
2 ms |
2648 KB |
Output is correct |
3 |
Correct |
2 ms |
2644 KB |
Output is correct |
4 |
Correct |
2 ms |
2644 KB |
Output is correct |
5 |
Correct |
2 ms |
2644 KB |
Output is correct |
6 |
Correct |
2 ms |
2644 KB |
Output is correct |
7 |
Correct |
2 ms |
2644 KB |
Output is correct |
8 |
Correct |
2 ms |
2644 KB |
Output is correct |
9 |
Correct |
38 ms |
9412 KB |
Output is correct |
10 |
Correct |
48 ms |
11048 KB |
Output is correct |
11 |
Correct |
50 ms |
10892 KB |
Output is correct |
12 |
Correct |
65 ms |
11340 KB |
Output is correct |
13 |
Correct |
57 ms |
11352 KB |
Output is correct |
14 |
Correct |
44 ms |
9820 KB |
Output is correct |
15 |
Correct |
103 ms |
15136 KB |
Output is correct |
16 |
Correct |
99 ms |
14976 KB |
Output is correct |
17 |
Correct |
103 ms |
15412 KB |
Output is correct |
18 |
Correct |
110 ms |
15552 KB |
Output is correct |
19 |
Correct |
52 ms |
9132 KB |
Output is correct |
20 |
Correct |
103 ms |
16232 KB |
Output is correct |
21 |
Correct |
101 ms |
16344 KB |
Output is correct |
22 |
Correct |
101 ms |
16900 KB |
Output is correct |
23 |
Correct |
105 ms |
16824 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
2644 KB |
Output is correct |
2 |
Correct |
2 ms |
2648 KB |
Output is correct |
3 |
Incorrect |
90 ms |
15172 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
2644 KB |
Output is correct |
2 |
Correct |
2 ms |
2648 KB |
Output is correct |
3 |
Correct |
2 ms |
2644 KB |
Output is correct |
4 |
Correct |
2 ms |
2644 KB |
Output is correct |
5 |
Correct |
2 ms |
2644 KB |
Output is correct |
6 |
Correct |
2 ms |
2644 KB |
Output is correct |
7 |
Correct |
2 ms |
2644 KB |
Output is correct |
8 |
Correct |
2 ms |
2644 KB |
Output is correct |
9 |
Incorrect |
2 ms |
2644 KB |
Output isn't correct |
10 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
2644 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
2644 KB |
Output is correct |
2 |
Correct |
2 ms |
2648 KB |
Output is correct |
3 |
Correct |
2 ms |
2644 KB |
Output is correct |
4 |
Correct |
2 ms |
2644 KB |
Output is correct |
5 |
Correct |
2 ms |
2644 KB |
Output is correct |
6 |
Correct |
2 ms |
2644 KB |
Output is correct |
7 |
Correct |
2 ms |
2644 KB |
Output is correct |
8 |
Correct |
2 ms |
2644 KB |
Output is correct |
9 |
Correct |
38 ms |
9412 KB |
Output is correct |
10 |
Correct |
48 ms |
11048 KB |
Output is correct |
11 |
Correct |
50 ms |
10892 KB |
Output is correct |
12 |
Correct |
65 ms |
11340 KB |
Output is correct |
13 |
Correct |
57 ms |
11352 KB |
Output is correct |
14 |
Correct |
44 ms |
9820 KB |
Output is correct |
15 |
Correct |
103 ms |
15136 KB |
Output is correct |
16 |
Correct |
99 ms |
14976 KB |
Output is correct |
17 |
Correct |
103 ms |
15412 KB |
Output is correct |
18 |
Correct |
110 ms |
15552 KB |
Output is correct |
19 |
Incorrect |
90 ms |
15172 KB |
Output isn't correct |
20 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
2644 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |