#include "bits/stdc++.h"
using namespace std;
#define ff first
#define ss second
#define all(v) v.begin(), v.end()
#define ll long long
#define pb push_back
#define pii pair<int, int>
#define wr puts("----------------")
template<class T>bool umin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
template<class T>bool umax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
const int MOD = 1e9+7;
const int INF = 1e9;
const int N = 2e5+5;
vector<pii> adj[N];
int mn = INF, mx = 0;
int deg[N];
void init(int n, int m, vector<int> u, vector<int> v, vector<int> w){
for(int i = 0; i < m; ++i){
adj[u[i]].pb({v[i], w[i]});
adj[v[i]].pb({u[i], w[i]});
umax(mx, w[i]);
deg[u[i]]++, deg[v[i]]++;
}
for(int i = 0; i < n; ++i)
umin(mn, deg[i]);
}
int getMinimumFuelCapacity(int x, int y){
if(mn == 1)
return -1;
else
return mx; // you need to traverse all edges on cycle
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
5724 KB |
Output is correct |
2 |
Correct |
1 ms |
5724 KB |
Output is correct |
3 |
Correct |
1 ms |
5724 KB |
Output is correct |
4 |
Correct |
1 ms |
5724 KB |
Output is correct |
5 |
Correct |
1 ms |
5724 KB |
Output is correct |
6 |
Correct |
2 ms |
5720 KB |
Output is correct |
7 |
Correct |
1 ms |
5724 KB |
Output is correct |
8 |
Correct |
1 ms |
5724 KB |
Output is correct |
9 |
Correct |
19 ms |
10240 KB |
Output is correct |
10 |
Correct |
25 ms |
10980 KB |
Output is correct |
11 |
Correct |
23 ms |
10972 KB |
Output is correct |
12 |
Correct |
25 ms |
11356 KB |
Output is correct |
13 |
Correct |
26 ms |
11352 KB |
Output is correct |
14 |
Correct |
22 ms |
10260 KB |
Output is correct |
15 |
Correct |
50 ms |
12928 KB |
Output is correct |
16 |
Correct |
54 ms |
12660 KB |
Output is correct |
17 |
Correct |
50 ms |
12984 KB |
Output is correct |
18 |
Correct |
50 ms |
12988 KB |
Output is correct |
19 |
Correct |
27 ms |
10064 KB |
Output is correct |
20 |
Correct |
50 ms |
18172 KB |
Output is correct |
21 |
Correct |
55 ms |
18448 KB |
Output is correct |
22 |
Correct |
60 ms |
18872 KB |
Output is correct |
23 |
Correct |
59 ms |
18880 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
5724 KB |
Output is correct |
2 |
Correct |
1 ms |
5724 KB |
Output is correct |
3 |
Incorrect |
44 ms |
13492 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
5724 KB |
Output is correct |
2 |
Correct |
1 ms |
5724 KB |
Output is correct |
3 |
Correct |
1 ms |
5724 KB |
Output is correct |
4 |
Correct |
1 ms |
5724 KB |
Output is correct |
5 |
Correct |
1 ms |
5724 KB |
Output is correct |
6 |
Correct |
2 ms |
5720 KB |
Output is correct |
7 |
Correct |
1 ms |
5724 KB |
Output is correct |
8 |
Correct |
1 ms |
5724 KB |
Output is correct |
9 |
Incorrect |
1 ms |
5720 KB |
Output isn't correct |
10 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
5720 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
5724 KB |
Output is correct |
2 |
Correct |
1 ms |
5724 KB |
Output is correct |
3 |
Correct |
1 ms |
5724 KB |
Output is correct |
4 |
Correct |
1 ms |
5724 KB |
Output is correct |
5 |
Correct |
1 ms |
5724 KB |
Output is correct |
6 |
Correct |
2 ms |
5720 KB |
Output is correct |
7 |
Correct |
1 ms |
5724 KB |
Output is correct |
8 |
Correct |
1 ms |
5724 KB |
Output is correct |
9 |
Correct |
19 ms |
10240 KB |
Output is correct |
10 |
Correct |
25 ms |
10980 KB |
Output is correct |
11 |
Correct |
23 ms |
10972 KB |
Output is correct |
12 |
Correct |
25 ms |
11356 KB |
Output is correct |
13 |
Correct |
26 ms |
11352 KB |
Output is correct |
14 |
Correct |
22 ms |
10260 KB |
Output is correct |
15 |
Correct |
50 ms |
12928 KB |
Output is correct |
16 |
Correct |
54 ms |
12660 KB |
Output is correct |
17 |
Correct |
50 ms |
12984 KB |
Output is correct |
18 |
Correct |
50 ms |
12988 KB |
Output is correct |
19 |
Incorrect |
44 ms |
13492 KB |
Output isn't correct |
20 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
5720 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |