#include "swap.h"
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <set>
#include <unordered_set>
#include <queue>
#include <deque>
#include <string>
#include <sstream>
#include <iomanip>
#include <map>
#include <unordered_map>
#include <stack>
#include <cstdio>
#include <climits>
#include <tuple>
#include <ctime>
#include <cstring>
#include <numeric>
#include <functional>
#include <chrono>
#include <cassert>
#include <bitset>
#include <fstream>
#define sz(a) ((int)((a).size()))
// printf("%.10f\n", ans);
using ll = long long;
using namespace std;
bool task1;
int n, m, mx_for_1, x, y;
vector<int> a, b, c;
vector<pair<int, int>> for_2;
bool task(int id)
{
if (id == 1)
{
vector<int> deg(n);
for (int i = 0; i < m; i++)
{
deg[a[i]]++;
deg[b[i]]++;
if (deg[a[i]] > 2 || deg[b[i]] > 2) return 0;
}
return 1;
}
}
void init(int N, int M, std::vector<int> U, std::vector<int> V, std::vector<int> W) {
n = N;
m = M;
a = U;
b = V;
c = W;
for_2 = vector<pair<int, int>>(m);
for (int& i : c) mx_for_1 = max(mx_for_1, i);
if (task(1)) task1 = 1;
}
int getMinimumFuelCapacity(int X, int Y) {
x = X;
y = Y;
if (task1)
{
if (m == n - 1) return -1;
return mx_for_1;
}
else
{
if (n <= 3) return 0;
if (x == 0)
{
}
}
}
Compilation message
swap.cpp: In function 'bool task(int)':
swap.cpp:49:1: warning: control reaches end of non-void function [-Wreturn-type]
49 | }
| ^
swap.cpp: In function 'int getMinimumFuelCapacity(int, int)':
swap.cpp:74:9: warning: control reaches end of non-void function [-Wreturn-type]
74 | if (x == 0)
| ~~^~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
224 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
1 ms |
212 KB |
Output is correct |
6 |
Correct |
1 ms |
212 KB |
Output is correct |
7 |
Correct |
1 ms |
340 KB |
Output is correct |
8 |
Correct |
1 ms |
340 KB |
Output is correct |
9 |
Correct |
24 ms |
3920 KB |
Output is correct |
10 |
Correct |
29 ms |
4756 KB |
Output is correct |
11 |
Correct |
29 ms |
4756 KB |
Output is correct |
12 |
Correct |
30 ms |
4936 KB |
Output is correct |
13 |
Correct |
32 ms |
4936 KB |
Output is correct |
14 |
Correct |
29 ms |
4040 KB |
Output is correct |
15 |
Correct |
79 ms |
6420 KB |
Output is correct |
16 |
Correct |
79 ms |
6160 KB |
Output is correct |
17 |
Correct |
81 ms |
6492 KB |
Output is correct |
18 |
Correct |
80 ms |
6472 KB |
Output is correct |
19 |
Correct |
47 ms |
4396 KB |
Output is correct |
20 |
Correct |
85 ms |
7328 KB |
Output is correct |
21 |
Correct |
83 ms |
7516 KB |
Output is correct |
22 |
Correct |
82 ms |
7740 KB |
Output is correct |
23 |
Correct |
85 ms |
7724 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Incorrect |
76 ms |
6220 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
224 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
1 ms |
212 KB |
Output is correct |
6 |
Correct |
1 ms |
212 KB |
Output is correct |
7 |
Correct |
1 ms |
340 KB |
Output is correct |
8 |
Correct |
1 ms |
340 KB |
Output is correct |
9 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
10 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
224 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
1 ms |
212 KB |
Output is correct |
6 |
Correct |
1 ms |
212 KB |
Output is correct |
7 |
Correct |
1 ms |
340 KB |
Output is correct |
8 |
Correct |
1 ms |
340 KB |
Output is correct |
9 |
Correct |
24 ms |
3920 KB |
Output is correct |
10 |
Correct |
29 ms |
4756 KB |
Output is correct |
11 |
Correct |
29 ms |
4756 KB |
Output is correct |
12 |
Correct |
30 ms |
4936 KB |
Output is correct |
13 |
Correct |
32 ms |
4936 KB |
Output is correct |
14 |
Correct |
29 ms |
4040 KB |
Output is correct |
15 |
Correct |
79 ms |
6420 KB |
Output is correct |
16 |
Correct |
79 ms |
6160 KB |
Output is correct |
17 |
Correct |
81 ms |
6492 KB |
Output is correct |
18 |
Correct |
80 ms |
6472 KB |
Output is correct |
19 |
Incorrect |
76 ms |
6220 KB |
Output isn't correct |
20 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |