#include "swap.h"
#include <vector>
#include<bits/stdc++.h>
using namespace std;
int n, m;
int ok = 1, mx = -1;
vector<vector<pair<int, int>>> adj;
void init(int N, int M, std::vector<int> U, std::vector<int> V, std::vector<int> W) {
n = N, m = M;
adj.resize(n + 2);
for (int i = 0; i < m; i++) {
adj[U[i]].push_back(make_pair(V[i], W[i]));
adj[V[i]].push_back(make_pair(U[i], W[i]));
mx = max(mx, W[i]);
}
for (int i = 0; i < n; i++) {
if (adj[i].size() <= 1) ok = 0;
}
}
int getMinimumFuelCapacity(int X, int Y) {
if (ok == 0) return -1;
else return mx;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
600 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
600 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
1 ms |
348 KB |
Output is correct |
6 |
Correct |
1 ms |
444 KB |
Output is correct |
7 |
Correct |
1 ms |
348 KB |
Output is correct |
8 |
Correct |
1 ms |
348 KB |
Output is correct |
9 |
Correct |
26 ms |
6492 KB |
Output is correct |
10 |
Correct |
32 ms |
7872 KB |
Output is correct |
11 |
Correct |
31 ms |
7772 KB |
Output is correct |
12 |
Correct |
33 ms |
8028 KB |
Output is correct |
13 |
Correct |
35 ms |
8020 KB |
Output is correct |
14 |
Correct |
30 ms |
6484 KB |
Output is correct |
15 |
Correct |
78 ms |
9952 KB |
Output is correct |
16 |
Correct |
73 ms |
9380 KB |
Output is correct |
17 |
Correct |
78 ms |
9916 KB |
Output is correct |
18 |
Correct |
74 ms |
9924 KB |
Output is correct |
19 |
Correct |
42 ms |
4952 KB |
Output is correct |
20 |
Correct |
74 ms |
10840 KB |
Output is correct |
21 |
Correct |
79 ms |
10764 KB |
Output is correct |
22 |
Correct |
80 ms |
11216 KB |
Output is correct |
23 |
Correct |
82 ms |
11196 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
600 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Incorrect |
67 ms |
10220 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
600 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
600 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
1 ms |
348 KB |
Output is correct |
6 |
Correct |
1 ms |
444 KB |
Output is correct |
7 |
Correct |
1 ms |
348 KB |
Output is correct |
8 |
Correct |
1 ms |
348 KB |
Output is correct |
9 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
10 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
600 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
600 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
1 ms |
348 KB |
Output is correct |
6 |
Correct |
1 ms |
444 KB |
Output is correct |
7 |
Correct |
1 ms |
348 KB |
Output is correct |
8 |
Correct |
1 ms |
348 KB |
Output is correct |
9 |
Correct |
26 ms |
6492 KB |
Output is correct |
10 |
Correct |
32 ms |
7872 KB |
Output is correct |
11 |
Correct |
31 ms |
7772 KB |
Output is correct |
12 |
Correct |
33 ms |
8028 KB |
Output is correct |
13 |
Correct |
35 ms |
8020 KB |
Output is correct |
14 |
Correct |
30 ms |
6484 KB |
Output is correct |
15 |
Correct |
78 ms |
9952 KB |
Output is correct |
16 |
Correct |
73 ms |
9380 KB |
Output is correct |
17 |
Correct |
78 ms |
9916 KB |
Output is correct |
18 |
Correct |
74 ms |
9924 KB |
Output is correct |
19 |
Incorrect |
67 ms |
10220 KB |
Output isn't correct |
20 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |