#include "swap.h"
#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
vector<pair<int, int>> ad[N];
int n, m;
int p[N];
bool sub1 = 1;
int answers1 = 0;
void init(int N, int M, vector<int> U, vector<int> V, vector<int> W) {
n = N; m = M;
for (int i = 1; i <= M; ++i) {
int u = U[i - 1], v = V[i - 1], w = W[i - 1];
// cerr << u << ' ' << v << ' ' << w << '\n';
ad[u].push_back({v, w});
ad[v].push_back({u, w});
answers1 = max(answers1, w);
if (ad[u].size() > 2 || ad[v].size() > 2) sub1 = 0;
}
}
int getMinimumFuelCapacity(int X, int Y) {
if (sub1) return (m == n - 1 ? -1 : answers1);
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
2904 KB |
Output is correct |
2 |
Correct |
2 ms |
2904 KB |
Output is correct |
3 |
Correct |
1 ms |
2908 KB |
Output is correct |
4 |
Correct |
1 ms |
2908 KB |
Output is correct |
5 |
Correct |
1 ms |
2908 KB |
Output is correct |
6 |
Correct |
2 ms |
2908 KB |
Output is correct |
7 |
Correct |
2 ms |
3016 KB |
Output is correct |
8 |
Correct |
1 ms |
2908 KB |
Output is correct |
9 |
Correct |
26 ms |
8788 KB |
Output is correct |
10 |
Correct |
42 ms |
10068 KB |
Output is correct |
11 |
Correct |
31 ms |
10072 KB |
Output is correct |
12 |
Correct |
35 ms |
10736 KB |
Output is correct |
13 |
Correct |
32 ms |
10440 KB |
Output is correct |
14 |
Correct |
29 ms |
9296 KB |
Output is correct |
15 |
Correct |
74 ms |
14412 KB |
Output is correct |
16 |
Correct |
71 ms |
14080 KB |
Output is correct |
17 |
Correct |
78 ms |
14452 KB |
Output is correct |
18 |
Correct |
72 ms |
14512 KB |
Output is correct |
19 |
Correct |
40 ms |
9308 KB |
Output is correct |
20 |
Correct |
73 ms |
15404 KB |
Output is correct |
21 |
Correct |
73 ms |
15556 KB |
Output is correct |
22 |
Correct |
77 ms |
15952 KB |
Output is correct |
23 |
Correct |
80 ms |
16060 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
2904 KB |
Output is correct |
2 |
Correct |
2 ms |
2904 KB |
Output is correct |
3 |
Incorrect |
70 ms |
14184 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
2904 KB |
Output is correct |
2 |
Correct |
2 ms |
2904 KB |
Output is correct |
3 |
Correct |
1 ms |
2908 KB |
Output is correct |
4 |
Correct |
1 ms |
2908 KB |
Output is correct |
5 |
Correct |
1 ms |
2908 KB |
Output is correct |
6 |
Correct |
2 ms |
2908 KB |
Output is correct |
7 |
Correct |
2 ms |
3016 KB |
Output is correct |
8 |
Correct |
1 ms |
2908 KB |
Output is correct |
9 |
Incorrect |
1 ms |
2904 KB |
Output isn't correct |
10 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
2904 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
2904 KB |
Output is correct |
2 |
Correct |
2 ms |
2904 KB |
Output is correct |
3 |
Correct |
1 ms |
2908 KB |
Output is correct |
4 |
Correct |
1 ms |
2908 KB |
Output is correct |
5 |
Correct |
1 ms |
2908 KB |
Output is correct |
6 |
Correct |
2 ms |
2908 KB |
Output is correct |
7 |
Correct |
2 ms |
3016 KB |
Output is correct |
8 |
Correct |
1 ms |
2908 KB |
Output is correct |
9 |
Correct |
26 ms |
8788 KB |
Output is correct |
10 |
Correct |
42 ms |
10068 KB |
Output is correct |
11 |
Correct |
31 ms |
10072 KB |
Output is correct |
12 |
Correct |
35 ms |
10736 KB |
Output is correct |
13 |
Correct |
32 ms |
10440 KB |
Output is correct |
14 |
Correct |
29 ms |
9296 KB |
Output is correct |
15 |
Correct |
74 ms |
14412 KB |
Output is correct |
16 |
Correct |
71 ms |
14080 KB |
Output is correct |
17 |
Correct |
78 ms |
14452 KB |
Output is correct |
18 |
Correct |
72 ms |
14512 KB |
Output is correct |
19 |
Incorrect |
70 ms |
14184 KB |
Output isn't correct |
20 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
2904 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |