#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define mk make_pair
int n, m;
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];
}
}
bool vis[200045];
int getMinimumFuelCapacity(int X, int Y) {
int flag = true, i;
for( i = 0; i < n; i ++ ){
if( vc[i].size() != 2 ){
flag = false;
break;
}
}
if( flag == true ){
int ans = 0;
for( i = 0; i < m; i ++ ){
ans = max( ans, w[i] );
}
return ans;
}
return -1;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
4940 KB |
Output is correct |
2 |
Correct |
4 ms |
4940 KB |
Output is correct |
3 |
Correct |
4 ms |
5004 KB |
Output is correct |
4 |
Correct |
4 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 |
5196 KB |
Output is correct |
8 |
Correct |
5 ms |
5196 KB |
Output is correct |
9 |
Correct |
161 ms |
20088 KB |
Output is correct |
10 |
Correct |
210 ms |
23492 KB |
Output is correct |
11 |
Correct |
198 ms |
23208 KB |
Output is correct |
12 |
Correct |
226 ms |
24260 KB |
Output is correct |
13 |
Correct |
224 ms |
24204 KB |
Output is correct |
14 |
Correct |
563 ms |
20132 KB |
Output is correct |
15 |
Execution timed out |
2069 ms |
28288 KB |
Time limit exceeded |
16 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
4940 KB |
Output is correct |
2 |
Correct |
4 ms |
4940 KB |
Output is correct |
3 |
Incorrect |
221 ms |
25392 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
4940 KB |
Output is correct |
2 |
Correct |
4 ms |
4940 KB |
Output is correct |
3 |
Correct |
4 ms |
5004 KB |
Output is correct |
4 |
Correct |
4 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 |
5196 KB |
Output is correct |
8 |
Correct |
5 ms |
5196 KB |
Output is correct |
9 |
Incorrect |
3 ms |
4944 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
4944 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
4940 KB |
Output is correct |
2 |
Correct |
4 ms |
4940 KB |
Output is correct |
3 |
Correct |
4 ms |
5004 KB |
Output is correct |
4 |
Correct |
4 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 |
5196 KB |
Output is correct |
8 |
Correct |
5 ms |
5196 KB |
Output is correct |
9 |
Correct |
161 ms |
20088 KB |
Output is correct |
10 |
Correct |
210 ms |
23492 KB |
Output is correct |
11 |
Correct |
198 ms |
23208 KB |
Output is correct |
12 |
Correct |
226 ms |
24260 KB |
Output is correct |
13 |
Correct |
224 ms |
24204 KB |
Output is correct |
14 |
Correct |
563 ms |
20132 KB |
Output is correct |
15 |
Execution timed out |
2069 ms |
28288 KB |
Time limit exceeded |
16 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
4944 KB |
Output isn't correct |