#include<bits/stdc++.h>
#include "parks.h"
using namespace std;
using ll = long long;
ll n, m, q, k, x, y, a, b, c;
struct dsu {
ll n;
vector<ll> par;
vector<ll> sz;
dsu(ll N) : n(N) {
par.resize(n);
sz.resize(n);
for (int i = 0; i < n; i++) {
par[i] = i;
sz[i] = 1;
}
}
ll find_p(ll x) {
if (par[x] == x) {
return x;
}
ll p = find_p(par[x]);
par[x] = p;
return p;
}
void join(ll x, ll y) {
x = find_p(x);
y = find_p(y);
if (x == y) {
return;
}
if (sz[y] > sz[x]) {
swap(x, y);
}
par[y] = x;
sz[x] += sz[y];
}
};
int construct_roads(vector<int> x, vector<int> y) {
n = x.size();
array< vector<int>, 4 > ans;
if (*max_element(x.begin(), x.end()) <= 6) {
vector< vector<ll> > v(7, vector<ll> (200001, -1));
for (int i = 0; i < n; i++) {
v[x[i]][y[i]] = i;
}
dsu d(n);
for (int i = 2; i < 200000; i += 2) {
if (v[2][i] != -1 && v[2][i + 2] != -1 && d.find_p(v[2][i]) != d.find_p(v[2][i + 2])) {
d.join(v[2][i], v[2][i + 2]);
ans[0].push_back(v[2][i]);
ans[1].push_back(v[2][i + 2]);
ans[2].push_back(1);
ans[3].push_back(i + 1);
}
if (v[6][i] != -1 && v[6][i + 2] != -1 && d.find_p(v[6][i]) != d.find_p(v[6][i + 2])) {
d.join(v[6][i], v[6][i + 2]);
ans[0].push_back(v[6][i]);
ans[1].push_back(v[6][i + 2]);
ans[2].push_back(7);
ans[3].push_back(i + 1);
}
}
vector< pair< ll, pair<ll, ll> > > vec;
for (int i = 2; i < 200000; i += 2) {
if (v[4][i] != -1 && v[4][i + 2] != -1 && d.find_p(v[4][i]) != d.find_p(v[4][i + 2])) {
d.join(v[4][i], v[4][i + 2]);
vec.push_back({i + 1, {v[4][i], v[4][i + 2]}});
}
}
for (int i = 2; i <= 200000; i += 2) {
if (v[4][i] != -1 && v[2][i] != -1 && d.find_p(v[4][i]) != d.find_p(v[2][i])) {
d.join(v[4][i], v[2][i]);
vec.push_back({i, {v[4][i], v[2][i]}});
}
if (v[4][i] != -1 && v[6][i] != -1 && d.find_p(v[4][i]) != d.find_p(v[6][i])) {
d.join(v[4][i], v[6][i]);
vec.push_back({i, {v[4][i], v[6][i]}});
}
}
set< pair<ll, ll> > st;
sort(vec.begin(), vec.end());
for (auto i : vec) {
if (i.first % 2 == 0) {
if (!st.count({(x[i.second.first] + x[i.second.second]) / 2, i.first - 1})) {
st.insert({(x[i.second.first] + x[i.second.second]) / 2, i.first - 1});
ans[0].push_back(i.second.first);
ans[1].push_back(i.second.second);
ans[2].push_back((x[i.second.first] + x[i.second.second]) / 2);
ans[3].push_back(i.first - 1);
}
else {
st.insert({(x[i.second.first] + x[i.second.second]) / 2, i.first + 1});
ans[0].push_back(i.second.first);
ans[1].push_back(i.second.second);
ans[2].push_back((x[i.second.first] + x[i.second.second]) / 2);
ans[3].push_back(i.first + 1);
}
}
else {
if (!st.count({(x[i.second.first] + x[i.second.second]) / 2 - 1, (y[i.second.first] + y[i.second.second]) / 2})) {
st.insert({(x[i.second.first] + x[i.second.second]) / 2 - 1, (y[i.second.first] + y[i.second.second]) / 2});
ans[0].push_back(i.second.first);
ans[1].push_back(i.second.second);
ans[2].push_back((x[i.second.first] + x[i.second.second]) / 2 - 1);
ans[3].push_back((y[i.second.first] + y[i.second.second]) / 2);
}
else {
st.insert({(x[i.second.first] + x[i.second.second]) / 2 + 1, (y[i.second.first] + y[i.second.second]) / 2});
ans[0].push_back(i.second.first);
ans[1].push_back(i.second.second);
ans[2].push_back((x[i.second.first] + x[i.second.second]) / 2 + 1);
ans[3].push_back((y[i.second.first] + y[i.second.second]) / 2);
}
}
}
if (d.sz[d.find_p(0)] != n) {
return 0;
}
build(ans[0], ans[1], ans[2], ans[3]);
return 1;
}
map< pair<ll, ll>, ll > pts;
for (int i = 0; i < n; i++) {
pts[{x[i], y[i]}] = i;
}
dsu d(n);
vector< pair< pair<ll, ll>, pair<ll, ll> > > vec;
for (int i = 0; i < n; i++) {
if (pts.count({x[i], y[i] - 2}) && d.find_p(i) != d.find_p(pts[{x[i], y[i] - 2}])) {
d.join(i, pts[{x[i], y[i] - 2}]);
vec.push_back({{x[i], y[i] - 1}, {i, pts[{x[i], y[i] - 2}]}});
}
if (pts.count({x[i], y[i] + 2}) && d.find_p(i) != d.find_p(pts[{x[i], y[i] + 2}])) {
d.join(i, pts[{x[i], y[i] + 2}]);
vec.push_back({{x[i], y[i] + 1}, {i, pts[{x[i], y[i] + 2}]}});
}
}
for (int i = 0; i < n; i++) {
if (pts.count({x[i] - 2, y[i]}) && d.find_p(i) != d.find_p(pts[{x[i] - 2, y[i]}])) {
d.join(i, pts[{x[i] - 2, y[i]}]);
vec.push_back({{x[i] - 1, y[i]}, {i, pts[{x[i] - 2, y[i]}]}});
}
if (pts.count({x[i] + 2, y[i]}) && d.find_p(i) != d.find_p(pts[{x[i] + 2, y[i]}])) {
d.join(i, pts[{x[i] + 2, y[i]}]);
vec.push_back({{x[i] + 1, y[i]}, {i, pts[{x[i] + 2, y[i]}]}});
}
}
set< pair<ll, ll> > st;
map< pair<ll, ll>, ll > occ;
sort(vec.begin(), vec.end());
for (auto i : vec) {
if (i.first.first % 2 == 0) {
if (!st.count({i.first.first - 1, i.first.second})) {
st.insert({i.first.first - 1, i.first.second});
ans[0].push_back(i.second.first);
ans[1].push_back(i.second.second);
ans[2].push_back(i.first.first - 1);
ans[3].push_back(i.first.second);
occ[{ans[2][ans[2].size() - 1], ans[3][ans[3].size() - 1]}] = ans[0].size() - 1;
}
else if (!st.count({i.first.first + 1, i.first.second})) {
st.insert({i.first.first + 1, i.first.second});
ans[0].push_back(i.second.first);
ans[1].push_back(i.second.second);
ans[2].push_back(i.first.first + 1);
ans[3].push_back(i.first.second);
occ[{ans[2][ans[2].size() - 1], ans[3][ans[3].size() - 1]}] = ans[0].size() - 1;
}
else {
ans[0].push_back(i.second.first);
ans[1].push_back(i.second.second);
pair<ll, ll> p = {i.first.first + 1, i.first.second};
ll idx = ans[0].size() - 1;
ans[2].push_back(-1);
ans[3].push_back(-1);
while (st.count(p)) {
pair<ll, ll> p1 = {x[occ[p]], y[occ[p]]};
pair<ll, ll> p2 = {p1.first + (p1.first - p.first), p1.second + (p1.second - p.second)};
swap(idx, occ[p]);
swap(ans[2][idx], ans[2][occ[p]]);
swap(ans[3][idx], ans[3][occ[p]]);
p = p2;
}
ans[2][idx] = p.first;
ans[3][idx] = p.second;
occ[{ans[2][idx], ans[3][idx]}] = idx;
}
}
else {
if (!st.count({i.first.first, i.first.second - 1})) {
st.insert({i.first.first, i.first.second - 1});
ans[0].push_back(i.second.first);
ans[1].push_back(i.second.second);
ans[2].push_back(i.first.first);
ans[3].push_back(i.first.second - 1);
occ[{ans[2][ans[2].size() - 1], ans[3][ans[3].size() - 1]}] = ans[0].size() - 1;
}
else if (!st.count({i.first.first, i.first.second + 1})) {
st.insert({i.first.first, i.first.second + 1});
ans[0].push_back(i.second.first);
ans[1].push_back(i.second.second);
ans[2].push_back(i.first.first);
ans[3].push_back(i.first.second + 1);
occ[{ans[2][ans[2].size() - 1], ans[3][ans[3].size() - 1]}] = ans[0].size() - 1;
}
else {
ans[0].push_back(i.second.first);
ans[1].push_back(i.second.second);
pair<ll, ll> p = {i.first.first, i.first.second + 1};
ll idx = ans[0].size() - 1;
ans[2].push_back(-1);
ans[3].push_back(-1);
while (st.count(p)) {
pair<ll, ll> p1 = {x[occ[p]], y[occ[p]]};
pair<ll, ll> p2 = {p1.first + (p1.first - p.first), p1.second + (p1.second - p.second)};
swap(idx, occ[p]);
swap(ans[2][idx], ans[2][occ[p]]);
swap(ans[3][idx], ans[3][occ[p]]);
p = p2;
}
ans[2][idx] = p.first;
ans[3][idx] = p.second;
occ[{ans[2][idx], ans[3][idx]}] = idx;
}
}
}
if (d.sz[d.find_p(0)] != n) {
return 0;
}
build(ans[0], ans[1], ans[2], ans[3]);
return 1;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
7 ms |
12888 KB |
Output is correct |
2 |
Correct |
9 ms |
12888 KB |
Output is correct |
3 |
Correct |
6 ms |
12892 KB |
Output is correct |
4 |
Correct |
5 ms |
12880 KB |
Output is correct |
5 |
Correct |
7 ms |
12892 KB |
Output is correct |
6 |
Correct |
8 ms |
12892 KB |
Output is correct |
7 |
Correct |
5 ms |
12892 KB |
Output is correct |
8 |
Correct |
5 ms |
12792 KB |
Output is correct |
9 |
Correct |
49 ms |
19516 KB |
Output is correct |
10 |
Correct |
8 ms |
12888 KB |
Output is correct |
11 |
Correct |
21 ms |
15680 KB |
Output is correct |
12 |
Correct |
10 ms |
13144 KB |
Output is correct |
13 |
Correct |
12 ms |
14080 KB |
Output is correct |
14 |
Correct |
5 ms |
12892 KB |
Output is correct |
15 |
Correct |
6 ms |
12892 KB |
Output is correct |
16 |
Correct |
42 ms |
19520 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
7 ms |
12888 KB |
Output is correct |
2 |
Correct |
9 ms |
12888 KB |
Output is correct |
3 |
Correct |
6 ms |
12892 KB |
Output is correct |
4 |
Correct |
5 ms |
12880 KB |
Output is correct |
5 |
Correct |
7 ms |
12892 KB |
Output is correct |
6 |
Correct |
8 ms |
12892 KB |
Output is correct |
7 |
Correct |
5 ms |
12892 KB |
Output is correct |
8 |
Correct |
5 ms |
12792 KB |
Output is correct |
9 |
Correct |
49 ms |
19516 KB |
Output is correct |
10 |
Correct |
8 ms |
12888 KB |
Output is correct |
11 |
Correct |
21 ms |
15680 KB |
Output is correct |
12 |
Correct |
10 ms |
13144 KB |
Output is correct |
13 |
Correct |
12 ms |
14080 KB |
Output is correct |
14 |
Correct |
5 ms |
12892 KB |
Output is correct |
15 |
Correct |
6 ms |
12892 KB |
Output is correct |
16 |
Correct |
42 ms |
19520 KB |
Output is correct |
17 |
Correct |
8 ms |
12888 KB |
Output is correct |
18 |
Correct |
8 ms |
12828 KB |
Output is correct |
19 |
Correct |
5 ms |
12892 KB |
Output is correct |
20 |
Correct |
5 ms |
12944 KB |
Output is correct |
21 |
Correct |
6 ms |
12892 KB |
Output is correct |
22 |
Correct |
8 ms |
12892 KB |
Output is correct |
23 |
Correct |
110 ms |
36148 KB |
Output is correct |
24 |
Correct |
5 ms |
12888 KB |
Output is correct |
25 |
Correct |
7 ms |
12892 KB |
Output is correct |
26 |
Correct |
6 ms |
12892 KB |
Output is correct |
27 |
Correct |
7 ms |
12828 KB |
Output is correct |
28 |
Correct |
44 ms |
21116 KB |
Output is correct |
29 |
Correct |
61 ms |
25884 KB |
Output is correct |
30 |
Correct |
85 ms |
31028 KB |
Output is correct |
31 |
Correct |
126 ms |
36536 KB |
Output is correct |
32 |
Correct |
5 ms |
12892 KB |
Output is correct |
33 |
Correct |
6 ms |
12760 KB |
Output is correct |
34 |
Correct |
5 ms |
12884 KB |
Output is correct |
35 |
Correct |
6 ms |
12888 KB |
Output is correct |
36 |
Correct |
5 ms |
12924 KB |
Output is correct |
37 |
Correct |
5 ms |
12892 KB |
Output is correct |
38 |
Correct |
6 ms |
12892 KB |
Output is correct |
39 |
Correct |
7 ms |
12888 KB |
Output is correct |
40 |
Correct |
6 ms |
12892 KB |
Output is correct |
41 |
Correct |
5 ms |
12892 KB |
Output is correct |
42 |
Correct |
6 ms |
12892 KB |
Output is correct |
43 |
Correct |
6 ms |
12936 KB |
Output is correct |
44 |
Correct |
9 ms |
12888 KB |
Output is correct |
45 |
Correct |
50 ms |
25056 KB |
Output is correct |
46 |
Correct |
79 ms |
31540 KB |
Output is correct |
47 |
Correct |
73 ms |
32056 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
7 ms |
12888 KB |
Output is correct |
2 |
Correct |
9 ms |
12888 KB |
Output is correct |
3 |
Correct |
6 ms |
12892 KB |
Output is correct |
4 |
Correct |
5 ms |
12880 KB |
Output is correct |
5 |
Correct |
7 ms |
12892 KB |
Output is correct |
6 |
Correct |
8 ms |
12892 KB |
Output is correct |
7 |
Correct |
5 ms |
12892 KB |
Output is correct |
8 |
Correct |
5 ms |
12792 KB |
Output is correct |
9 |
Correct |
49 ms |
19516 KB |
Output is correct |
10 |
Correct |
8 ms |
12888 KB |
Output is correct |
11 |
Correct |
21 ms |
15680 KB |
Output is correct |
12 |
Correct |
10 ms |
13144 KB |
Output is correct |
13 |
Correct |
12 ms |
14080 KB |
Output is correct |
14 |
Correct |
5 ms |
12892 KB |
Output is correct |
15 |
Correct |
6 ms |
12892 KB |
Output is correct |
16 |
Correct |
42 ms |
19520 KB |
Output is correct |
17 |
Correct |
8 ms |
12888 KB |
Output is correct |
18 |
Correct |
8 ms |
12828 KB |
Output is correct |
19 |
Correct |
5 ms |
12892 KB |
Output is correct |
20 |
Correct |
5 ms |
12944 KB |
Output is correct |
21 |
Correct |
6 ms |
12892 KB |
Output is correct |
22 |
Correct |
8 ms |
12892 KB |
Output is correct |
23 |
Correct |
110 ms |
36148 KB |
Output is correct |
24 |
Correct |
5 ms |
12888 KB |
Output is correct |
25 |
Correct |
7 ms |
12892 KB |
Output is correct |
26 |
Correct |
6 ms |
12892 KB |
Output is correct |
27 |
Correct |
7 ms |
12828 KB |
Output is correct |
28 |
Correct |
44 ms |
21116 KB |
Output is correct |
29 |
Correct |
61 ms |
25884 KB |
Output is correct |
30 |
Correct |
85 ms |
31028 KB |
Output is correct |
31 |
Correct |
126 ms |
36536 KB |
Output is correct |
32 |
Correct |
5 ms |
12892 KB |
Output is correct |
33 |
Correct |
6 ms |
12760 KB |
Output is correct |
34 |
Correct |
5 ms |
12884 KB |
Output is correct |
35 |
Correct |
6 ms |
12888 KB |
Output is correct |
36 |
Correct |
5 ms |
12924 KB |
Output is correct |
37 |
Correct |
5 ms |
12892 KB |
Output is correct |
38 |
Correct |
6 ms |
12892 KB |
Output is correct |
39 |
Correct |
7 ms |
12888 KB |
Output is correct |
40 |
Correct |
6 ms |
12892 KB |
Output is correct |
41 |
Correct |
5 ms |
12892 KB |
Output is correct |
42 |
Correct |
6 ms |
12892 KB |
Output is correct |
43 |
Correct |
6 ms |
12936 KB |
Output is correct |
44 |
Correct |
9 ms |
12888 KB |
Output is correct |
45 |
Correct |
50 ms |
25056 KB |
Output is correct |
46 |
Correct |
79 ms |
31540 KB |
Output is correct |
47 |
Correct |
73 ms |
32056 KB |
Output is correct |
48 |
Correct |
7 ms |
12888 KB |
Output is correct |
49 |
Correct |
7 ms |
12888 KB |
Output is correct |
50 |
Correct |
8 ms |
12892 KB |
Output is correct |
51 |
Correct |
8 ms |
12892 KB |
Output is correct |
52 |
Correct |
6 ms |
12888 KB |
Output is correct |
53 |
Correct |
5 ms |
12892 KB |
Output is correct |
54 |
Correct |
6 ms |
12892 KB |
Output is correct |
55 |
Correct |
113 ms |
34448 KB |
Output is correct |
56 |
Correct |
6 ms |
12892 KB |
Output is correct |
57 |
Correct |
6 ms |
12892 KB |
Output is correct |
58 |
Correct |
12 ms |
12892 KB |
Output is correct |
59 |
Correct |
12 ms |
12892 KB |
Output is correct |
60 |
Correct |
43 ms |
22260 KB |
Output is correct |
61 |
Correct |
59 ms |
26944 KB |
Output is correct |
62 |
Correct |
74 ms |
29404 KB |
Output is correct |
63 |
Correct |
92 ms |
32820 KB |
Output is correct |
64 |
Correct |
7 ms |
12892 KB |
Output is correct |
65 |
Correct |
6 ms |
12812 KB |
Output is correct |
66 |
Correct |
6 ms |
12916 KB |
Output is correct |
67 |
Correct |
72 ms |
27580 KB |
Output is correct |
68 |
Correct |
69 ms |
27704 KB |
Output is correct |
69 |
Correct |
69 ms |
27700 KB |
Output is correct |
70 |
Correct |
7 ms |
12888 KB |
Output is correct |
71 |
Correct |
7 ms |
12892 KB |
Output is correct |
72 |
Correct |
48 ms |
23712 KB |
Output is correct |
73 |
Correct |
71 ms |
31284 KB |
Output is correct |
74 |
Correct |
96 ms |
36284 KB |
Output is correct |
75 |
Correct |
82 ms |
30516 KB |
Output is correct |
76 |
Correct |
76 ms |
27796 KB |
Output is correct |
77 |
Correct |
7 ms |
12892 KB |
Output is correct |
78 |
Correct |
7 ms |
12884 KB |
Output is correct |
79 |
Correct |
47 ms |
23360 KB |
Output is correct |
80 |
Correct |
70 ms |
30520 KB |
Output is correct |
81 |
Correct |
114 ms |
35128 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
7 ms |
12888 KB |
Output is correct |
2 |
Correct |
9 ms |
12888 KB |
Output is correct |
3 |
Correct |
6 ms |
12892 KB |
Output is correct |
4 |
Correct |
5 ms |
12880 KB |
Output is correct |
5 |
Correct |
7 ms |
12892 KB |
Output is correct |
6 |
Correct |
8 ms |
12892 KB |
Output is correct |
7 |
Correct |
5 ms |
12892 KB |
Output is correct |
8 |
Correct |
5 ms |
12792 KB |
Output is correct |
9 |
Correct |
49 ms |
19516 KB |
Output is correct |
10 |
Correct |
8 ms |
12888 KB |
Output is correct |
11 |
Correct |
21 ms |
15680 KB |
Output is correct |
12 |
Correct |
10 ms |
13144 KB |
Output is correct |
13 |
Correct |
12 ms |
14080 KB |
Output is correct |
14 |
Correct |
5 ms |
12892 KB |
Output is correct |
15 |
Correct |
6 ms |
12892 KB |
Output is correct |
16 |
Correct |
42 ms |
19520 KB |
Output is correct |
17 |
Correct |
0 ms |
344 KB |
Output is correct |
18 |
Correct |
0 ms |
348 KB |
Output is correct |
19 |
Correct |
0 ms |
348 KB |
Output is correct |
20 |
Correct |
531 ms |
60164 KB |
Output is correct |
21 |
Correct |
548 ms |
61228 KB |
Output is correct |
22 |
Correct |
549 ms |
62140 KB |
Output is correct |
23 |
Correct |
431 ms |
52856 KB |
Output is correct |
24 |
Correct |
204 ms |
18996 KB |
Output is correct |
25 |
Correct |
521 ms |
54340 KB |
Output is correct |
26 |
Correct |
429 ms |
53692 KB |
Output is correct |
27 |
Correct |
503 ms |
60088 KB |
Output is correct |
28 |
Correct |
515 ms |
61308 KB |
Output is correct |
29 |
Correct |
600 ms |
60780 KB |
Output is correct |
30 |
Correct |
670 ms |
60920 KB |
Output is correct |
31 |
Correct |
0 ms |
348 KB |
Output is correct |
32 |
Incorrect |
28 ms |
4604 KB |
Tree (a[631], b[631]) = (186115, 20819) is not adjacent to edge between u[631]=4162 @(185724, 20412) and v[631]=10659 @(185724, 20414) |
33 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
7 ms |
12888 KB |
Output is correct |
2 |
Correct |
9 ms |
12888 KB |
Output is correct |
3 |
Correct |
6 ms |
12892 KB |
Output is correct |
4 |
Correct |
5 ms |
12880 KB |
Output is correct |
5 |
Correct |
7 ms |
12892 KB |
Output is correct |
6 |
Correct |
8 ms |
12892 KB |
Output is correct |
7 |
Correct |
5 ms |
12892 KB |
Output is correct |
8 |
Correct |
5 ms |
12792 KB |
Output is correct |
9 |
Correct |
49 ms |
19516 KB |
Output is correct |
10 |
Correct |
8 ms |
12888 KB |
Output is correct |
11 |
Correct |
21 ms |
15680 KB |
Output is correct |
12 |
Correct |
10 ms |
13144 KB |
Output is correct |
13 |
Correct |
12 ms |
14080 KB |
Output is correct |
14 |
Correct |
5 ms |
12892 KB |
Output is correct |
15 |
Correct |
6 ms |
12892 KB |
Output is correct |
16 |
Correct |
42 ms |
19520 KB |
Output is correct |
17 |
Correct |
536 ms |
60688 KB |
Output is correct |
18 |
Correct |
532 ms |
60092 KB |
Output is correct |
19 |
Correct |
580 ms |
61492 KB |
Output is correct |
20 |
Correct |
577 ms |
60504 KB |
Output is correct |
21 |
Correct |
485 ms |
53740 KB |
Output is correct |
22 |
Correct |
0 ms |
348 KB |
Output is correct |
23 |
Incorrect |
67 ms |
9516 KB |
Tree (a[1150], b[1150]) = (186745, 22077) is not adjacent to edge between u[1150]=9213 @(185186, 20678) and v[1150]=18399 @(185186, 20680) |
24 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
7 ms |
12888 KB |
Output is correct |
2 |
Correct |
9 ms |
12888 KB |
Output is correct |
3 |
Correct |
6 ms |
12892 KB |
Output is correct |
4 |
Correct |
5 ms |
12880 KB |
Output is correct |
5 |
Correct |
7 ms |
12892 KB |
Output is correct |
6 |
Correct |
8 ms |
12892 KB |
Output is correct |
7 |
Correct |
5 ms |
12892 KB |
Output is correct |
8 |
Correct |
5 ms |
12792 KB |
Output is correct |
9 |
Correct |
49 ms |
19516 KB |
Output is correct |
10 |
Correct |
8 ms |
12888 KB |
Output is correct |
11 |
Correct |
21 ms |
15680 KB |
Output is correct |
12 |
Correct |
10 ms |
13144 KB |
Output is correct |
13 |
Correct |
12 ms |
14080 KB |
Output is correct |
14 |
Correct |
5 ms |
12892 KB |
Output is correct |
15 |
Correct |
6 ms |
12892 KB |
Output is correct |
16 |
Correct |
42 ms |
19520 KB |
Output is correct |
17 |
Correct |
8 ms |
12888 KB |
Output is correct |
18 |
Correct |
8 ms |
12828 KB |
Output is correct |
19 |
Correct |
5 ms |
12892 KB |
Output is correct |
20 |
Correct |
5 ms |
12944 KB |
Output is correct |
21 |
Correct |
6 ms |
12892 KB |
Output is correct |
22 |
Correct |
8 ms |
12892 KB |
Output is correct |
23 |
Correct |
110 ms |
36148 KB |
Output is correct |
24 |
Correct |
5 ms |
12888 KB |
Output is correct |
25 |
Correct |
7 ms |
12892 KB |
Output is correct |
26 |
Correct |
6 ms |
12892 KB |
Output is correct |
27 |
Correct |
7 ms |
12828 KB |
Output is correct |
28 |
Correct |
44 ms |
21116 KB |
Output is correct |
29 |
Correct |
61 ms |
25884 KB |
Output is correct |
30 |
Correct |
85 ms |
31028 KB |
Output is correct |
31 |
Correct |
126 ms |
36536 KB |
Output is correct |
32 |
Correct |
5 ms |
12892 KB |
Output is correct |
33 |
Correct |
6 ms |
12760 KB |
Output is correct |
34 |
Correct |
5 ms |
12884 KB |
Output is correct |
35 |
Correct |
6 ms |
12888 KB |
Output is correct |
36 |
Correct |
5 ms |
12924 KB |
Output is correct |
37 |
Correct |
5 ms |
12892 KB |
Output is correct |
38 |
Correct |
6 ms |
12892 KB |
Output is correct |
39 |
Correct |
7 ms |
12888 KB |
Output is correct |
40 |
Correct |
6 ms |
12892 KB |
Output is correct |
41 |
Correct |
5 ms |
12892 KB |
Output is correct |
42 |
Correct |
6 ms |
12892 KB |
Output is correct |
43 |
Correct |
6 ms |
12936 KB |
Output is correct |
44 |
Correct |
9 ms |
12888 KB |
Output is correct |
45 |
Correct |
50 ms |
25056 KB |
Output is correct |
46 |
Correct |
79 ms |
31540 KB |
Output is correct |
47 |
Correct |
73 ms |
32056 KB |
Output is correct |
48 |
Correct |
7 ms |
12888 KB |
Output is correct |
49 |
Correct |
7 ms |
12888 KB |
Output is correct |
50 |
Correct |
8 ms |
12892 KB |
Output is correct |
51 |
Correct |
8 ms |
12892 KB |
Output is correct |
52 |
Correct |
6 ms |
12888 KB |
Output is correct |
53 |
Correct |
5 ms |
12892 KB |
Output is correct |
54 |
Correct |
6 ms |
12892 KB |
Output is correct |
55 |
Correct |
113 ms |
34448 KB |
Output is correct |
56 |
Correct |
6 ms |
12892 KB |
Output is correct |
57 |
Correct |
6 ms |
12892 KB |
Output is correct |
58 |
Correct |
12 ms |
12892 KB |
Output is correct |
59 |
Correct |
12 ms |
12892 KB |
Output is correct |
60 |
Correct |
43 ms |
22260 KB |
Output is correct |
61 |
Correct |
59 ms |
26944 KB |
Output is correct |
62 |
Correct |
74 ms |
29404 KB |
Output is correct |
63 |
Correct |
92 ms |
32820 KB |
Output is correct |
64 |
Correct |
7 ms |
12892 KB |
Output is correct |
65 |
Correct |
6 ms |
12812 KB |
Output is correct |
66 |
Correct |
6 ms |
12916 KB |
Output is correct |
67 |
Correct |
72 ms |
27580 KB |
Output is correct |
68 |
Correct |
69 ms |
27704 KB |
Output is correct |
69 |
Correct |
69 ms |
27700 KB |
Output is correct |
70 |
Correct |
7 ms |
12888 KB |
Output is correct |
71 |
Correct |
7 ms |
12892 KB |
Output is correct |
72 |
Correct |
48 ms |
23712 KB |
Output is correct |
73 |
Correct |
71 ms |
31284 KB |
Output is correct |
74 |
Correct |
96 ms |
36284 KB |
Output is correct |
75 |
Correct |
82 ms |
30516 KB |
Output is correct |
76 |
Correct |
76 ms |
27796 KB |
Output is correct |
77 |
Correct |
7 ms |
12892 KB |
Output is correct |
78 |
Correct |
7 ms |
12884 KB |
Output is correct |
79 |
Correct |
47 ms |
23360 KB |
Output is correct |
80 |
Correct |
70 ms |
30520 KB |
Output is correct |
81 |
Correct |
114 ms |
35128 KB |
Output is correct |
82 |
Correct |
0 ms |
344 KB |
Output is correct |
83 |
Correct |
0 ms |
348 KB |
Output is correct |
84 |
Correct |
0 ms |
348 KB |
Output is correct |
85 |
Correct |
531 ms |
60164 KB |
Output is correct |
86 |
Correct |
548 ms |
61228 KB |
Output is correct |
87 |
Correct |
549 ms |
62140 KB |
Output is correct |
88 |
Correct |
431 ms |
52856 KB |
Output is correct |
89 |
Correct |
204 ms |
18996 KB |
Output is correct |
90 |
Correct |
521 ms |
54340 KB |
Output is correct |
91 |
Correct |
429 ms |
53692 KB |
Output is correct |
92 |
Correct |
503 ms |
60088 KB |
Output is correct |
93 |
Correct |
515 ms |
61308 KB |
Output is correct |
94 |
Correct |
600 ms |
60780 KB |
Output is correct |
95 |
Correct |
670 ms |
60920 KB |
Output is correct |
96 |
Correct |
0 ms |
348 KB |
Output is correct |
97 |
Incorrect |
28 ms |
4604 KB |
Tree (a[631], b[631]) = (186115, 20819) is not adjacent to edge between u[631]=4162 @(185724, 20412) and v[631]=10659 @(185724, 20414) |
98 |
Halted |
0 ms |
0 KB |
- |