#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define mk make_pair
int n, m, flag = true;
int ans = 0;
vector < int > u, v, w;
vector < int > vc[200045];
map < pair < int , int >, int > mp;
void init(int N, int M,
std::vector<int> U, std::vector<int> V, std::vector<int> W) {
int i;
n = N;
m = M;
u = U;
v = V;
w = W;
for( i = 0; i < m; i ++ ){
vc[ u[i] ].pb( v[i] );
vc[ v[i] ].pb( u[i] );
mp[ mk( u[i], v[i] ) ] = w[i];
mp[ mk( v[i], u[i] ) ] = w[i];
}
for( i = 0; i < n; i ++ ){
if( vc[i].size() != 2 ){
flag = false;
break;
}
}
for( i = 0; i < m; i ++ ){
ans = max( ans, w[i] );
}
}
bool vis[200045];
int getMinimumFuelCapacity(int X, int Y) {
int i;
if( flag == true ){
return ans;
}
return -1;
}
Compilation message
swap.cpp: In function 'int getMinimumFuelCapacity(int, int)':
swap.cpp:38:6: warning: unused variable 'i' [-Wunused-variable]
38 | int i;
| ^
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
4940 KB |
Output is correct |
2 |
Correct |
3 ms |
4940 KB |
Output is correct |
3 |
Correct |
3 ms |
4940 KB |
Output is correct |
4 |
Correct |
3 ms |
5068 KB |
Output is correct |
5 |
Correct |
4 ms |
5068 KB |
Output is correct |
6 |
Correct |
4 ms |
5068 KB |
Output is correct |
7 |
Correct |
4 ms |
5072 KB |
Output is correct |
8 |
Correct |
4 ms |
5068 KB |
Output is correct |
9 |
Correct |
170 ms |
19940 KB |
Output is correct |
10 |
Correct |
194 ms |
23356 KB |
Output is correct |
11 |
Correct |
195 ms |
23116 KB |
Output is correct |
12 |
Correct |
213 ms |
24152 KB |
Output is correct |
13 |
Correct |
200 ms |
24240 KB |
Output is correct |
14 |
Correct |
152 ms |
20128 KB |
Output is correct |
15 |
Correct |
259 ms |
25364 KB |
Output is correct |
16 |
Correct |
280 ms |
24840 KB |
Output is correct |
17 |
Correct |
293 ms |
25864 KB |
Output is correct |
18 |
Correct |
275 ms |
25996 KB |
Output is correct |
19 |
Correct |
92 ms |
11460 KB |
Output is correct |
20 |
Correct |
264 ms |
26532 KB |
Output is correct |
21 |
Correct |
263 ms |
26108 KB |
Output is correct |
22 |
Correct |
288 ms |
27292 KB |
Output is correct |
23 |
Correct |
285 ms |
27268 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
4940 KB |
Output is correct |
2 |
Correct |
3 ms |
4940 KB |
Output is correct |
3 |
Incorrect |
217 ms |
25208 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
4940 KB |
Output is correct |
2 |
Correct |
3 ms |
4940 KB |
Output is correct |
3 |
Correct |
3 ms |
4940 KB |
Output is correct |
4 |
Correct |
3 ms |
5068 KB |
Output is correct |
5 |
Correct |
4 ms |
5068 KB |
Output is correct |
6 |
Correct |
4 ms |
5068 KB |
Output is correct |
7 |
Correct |
4 ms |
5072 KB |
Output is correct |
8 |
Correct |
4 ms |
5068 KB |
Output is correct |
9 |
Incorrect |
4 ms |
4940 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
4 ms |
4940 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
4940 KB |
Output is correct |
2 |
Correct |
3 ms |
4940 KB |
Output is correct |
3 |
Correct |
3 ms |
4940 KB |
Output is correct |
4 |
Correct |
3 ms |
5068 KB |
Output is correct |
5 |
Correct |
4 ms |
5068 KB |
Output is correct |
6 |
Correct |
4 ms |
5068 KB |
Output is correct |
7 |
Correct |
4 ms |
5072 KB |
Output is correct |
8 |
Correct |
4 ms |
5068 KB |
Output is correct |
9 |
Correct |
170 ms |
19940 KB |
Output is correct |
10 |
Correct |
194 ms |
23356 KB |
Output is correct |
11 |
Correct |
195 ms |
23116 KB |
Output is correct |
12 |
Correct |
213 ms |
24152 KB |
Output is correct |
13 |
Correct |
200 ms |
24240 KB |
Output is correct |
14 |
Correct |
152 ms |
20128 KB |
Output is correct |
15 |
Correct |
259 ms |
25364 KB |
Output is correct |
16 |
Correct |
280 ms |
24840 KB |
Output is correct |
17 |
Correct |
293 ms |
25864 KB |
Output is correct |
18 |
Correct |
275 ms |
25996 KB |
Output is correct |
19 |
Incorrect |
217 ms |
25208 KB |
Output isn't correct |
20 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
4 ms |
4940 KB |
Output isn't correct |