#include "swap.h"
#include<iostream>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<deque>
#define ll long long
#define pl pair<ll, ll>
#define llv vector<ll>
#define pb push_back
#define ppb(x, y) push_back({x, y})
#define pv vector<pl>
#define sz size()
using namespace std;
const int N = 2 * 1e5 + 3;
int n, m, a = 0, b = 0;
pv v[N];
bool q = 1;
void init(int N, int M, vector<int> U, vector<int> V, vector<int> W)
{
n = N;
m = M;
for (int i=0; i<m; i++)
{
v[V[i]].ppb(U[i], W[i]);
v[U[i]].ppb(V[i], W[i]);
}
for (int i=0; i<n; i++)
{
if (v[i].sz == 2) a++;
if (v[i].sz == 1) b++;
}
if (b == 2 && a + b == n) q = 0;
return ;
}
int getMinimumFuelCapacity(int X, int Y)
{
if (q)
{
return 1;
}
else return -1;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
4940 KB |
Output is correct |
2 |
Correct |
4 ms |
5064 KB |
Output is correct |
3 |
Correct |
4 ms |
4940 KB |
Output is correct |
4 |
Correct |
4 ms |
4940 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 |
5068 KB |
Output is correct |
8 |
Correct |
4 ms |
5068 KB |
Output is correct |
9 |
Correct |
52 ms |
10908 KB |
Output is correct |
10 |
Correct |
82 ms |
12268 KB |
Output is correct |
11 |
Correct |
77 ms |
12120 KB |
Output is correct |
12 |
Correct |
67 ms |
12432 KB |
Output is correct |
13 |
Correct |
64 ms |
12484 KB |
Output is correct |
14 |
Correct |
57 ms |
11076 KB |
Output is correct |
15 |
Correct |
132 ms |
14208 KB |
Output is correct |
16 |
Correct |
146 ms |
13936 KB |
Output is correct |
17 |
Correct |
156 ms |
14328 KB |
Output is correct |
18 |
Correct |
124 ms |
14244 KB |
Output is correct |
19 |
Incorrect |
59 ms |
8352 KB |
Output isn't correct |
20 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
4940 KB |
Output is correct |
2 |
Correct |
4 ms |
5064 KB |
Output is correct |
3 |
Incorrect |
106 ms |
13172 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 |
5064 KB |
Output is correct |
3 |
Correct |
4 ms |
4940 KB |
Output is correct |
4 |
Correct |
4 ms |
4940 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 |
5068 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 |
4 ms |
4940 KB |
Output is correct |
2 |
Correct |
4 ms |
5064 KB |
Output is correct |
3 |
Correct |
4 ms |
4940 KB |
Output is correct |
4 |
Correct |
4 ms |
4940 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 |
5068 KB |
Output is correct |
8 |
Correct |
4 ms |
5068 KB |
Output is correct |
9 |
Correct |
52 ms |
10908 KB |
Output is correct |
10 |
Correct |
82 ms |
12268 KB |
Output is correct |
11 |
Correct |
77 ms |
12120 KB |
Output is correct |
12 |
Correct |
67 ms |
12432 KB |
Output is correct |
13 |
Correct |
64 ms |
12484 KB |
Output is correct |
14 |
Correct |
57 ms |
11076 KB |
Output is correct |
15 |
Correct |
132 ms |
14208 KB |
Output is correct |
16 |
Correct |
146 ms |
13936 KB |
Output is correct |
17 |
Correct |
156 ms |
14328 KB |
Output is correct |
18 |
Correct |
124 ms |
14244 KB |
Output is correct |
19 |
Incorrect |
106 ms |
13172 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 |