#include "parks.h"
using namespace std;
#include<bits/stdc++.h>
#define vec vector
#define coord pair<int, int>
#define fst first
#define snd second
void dfs(int u, set<int>& vis, vec<vec<int>>& g, vec<int>& us, vec<int>& vs) {
for(int v : g[u]) {
if(vis.find(v) != vis.end()) {
continue;
}
vis.insert(v);
us.push_back(u);
vs.push_back(v);
dfs(v, vis, g, us, vs);
}
}
int construct_roads(std::vector<int> x, std::vector<int> y) {
int n = x.size();
// construct graph
map<coord, int> points;
for(int i = 0; i<n; i++) points.insert({{x[i], y[i]}, i});
vec<vec<int>> g(n);
for(int i = 0; i<n; i++) {
vec<coord> pot_neigh = {{x[i]+2, y[i]}, {x[i], y[i]+2}};
for(coord c : pot_neigh) {
auto it = points.find(c);
if(it == points.end()) continue;
int j = (*it).snd;
g[i].push_back(j);
g[j].push_back(i);
}
}
// use dfs tree of the graph to construct u and v
vec<int> us(0), vs(0);
set<int> vis;
vis.insert(0);
dfs(0, vis, g, us, vs);
if(us.size() != n-1) {
return 0;
}
// for each edge of the tree, create set of two red points it can use, and for each red point, corresponding edges that want it
vec<set<coord>> edge_red_points(n-1);
map<coord, set<int>> red_point_edges;
for(int i = 0; i<n-1; i++) {
vec<coord> eps{{x[us[i]], y[us[i]]}, {x[vs[i]], y[vs[i]]}};
sort(eps.begin(), eps.end());
set<coord> red_points;
if(eps[0].fst == eps[1].fst) {
red_points.insert({eps[0].fst+1, (eps[0].snd+eps[1].snd)/2});
red_points.insert({eps[0].fst-1, (eps[0].snd+eps[1].snd)/2});
}
else {
red_points.insert({(eps[0].fst+eps[1].fst)/2, eps[0].snd+1});
red_points.insert({(eps[0].fst+eps[1].fst)/2, eps[0].snd-1});
}
edge_red_points[i] = red_points;
for(coord _coord : red_points) {
red_point_edges[_coord].insert(i);
}
}
// assign red points to edges, iterate from first edge to last, if it isn't assigned, give it any of the two, as long as there are edges that have only one avilable as consequence assign them that one availble
vec<bool> ass(n-1, false);
vec<int> ass_xs(n-1);
vec<int> ass_ys(n-1);
for(auto red_point : red_point_edges) {
if(red_point.snd.size() == 1) {
int edge = *(red_point.snd.begin());
ass[edge] = true;
ass_xs[edge] = red_point.fst.fst;
ass_ys[edge] = red_point.fst.snd;
}
}
for(int i = 0; i<n-1; i++) {
if(ass[i]) continue;
assert(edge_red_points[i].size() == 2);
coord red_point = *edge_red_points[i].begin();
red_point_edges[red_point].erase(i);
edge_red_points[i].erase(red_point);
ass[i] = true;
ass_xs[i] = red_point.fst;
ass_ys[i] = red_point.snd;
vec<coord> rem_red_points{red_point};
while(rem_red_points.size() > 0) {
red_point = rem_red_points.back();
rem_red_points.pop_back();
for(int j : red_point_edges[red_point]) {
if(ass[j]) {
continue;
}
edge_red_points[j].erase(red_point);
assert(edge_red_points[j].size() == 1);
coord other = *edge_red_points[j].begin();
ass[j] = true;
ass_xs[j] = other.fst;
ass_ys[j] = other.snd;
red_point_edges[other].erase(j);
edge_red_points[j].erase(red_point);
rem_red_points.push_back(other);
}
}
}
build(us, vs, ass_xs, ass_ys);
return 1;
}
Compilation message
parks.cpp: In function 'int construct_roads(std::vector<int>, std::vector<int>)':
parks.cpp:50:15: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
50 | if(us.size() != n-1) {
| ~~~~~~~~~~^~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
436 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
1 ms |
348 KB |
Output is correct |
9 |
Correct |
282 ms |
76072 KB |
Output is correct |
10 |
Correct |
17 ms |
8024 KB |
Output is correct |
11 |
Correct |
102 ms |
41552 KB |
Output is correct |
12 |
Correct |
26 ms |
11856 KB |
Output is correct |
13 |
Correct |
33 ms |
11604 KB |
Output is correct |
14 |
Correct |
1 ms |
604 KB |
Output is correct |
15 |
Correct |
1 ms |
604 KB |
Output is correct |
16 |
Correct |
268 ms |
71648 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
436 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
1 ms |
348 KB |
Output is correct |
9 |
Correct |
282 ms |
76072 KB |
Output is correct |
10 |
Correct |
17 ms |
8024 KB |
Output is correct |
11 |
Correct |
102 ms |
41552 KB |
Output is correct |
12 |
Correct |
26 ms |
11856 KB |
Output is correct |
13 |
Correct |
33 ms |
11604 KB |
Output is correct |
14 |
Correct |
1 ms |
604 KB |
Output is correct |
15 |
Correct |
1 ms |
604 KB |
Output is correct |
16 |
Correct |
268 ms |
71648 KB |
Output is correct |
17 |
Correct |
1 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 |
0 ms |
348 KB |
Output is correct |
21 |
Correct |
1 ms |
344 KB |
Output is correct |
22 |
Correct |
0 ms |
344 KB |
Output is correct |
23 |
Correct |
727 ms |
131672 KB |
Output is correct |
24 |
Correct |
0 ms |
348 KB |
Output is correct |
25 |
Correct |
2 ms |
1116 KB |
Output is correct |
26 |
Correct |
3 ms |
860 KB |
Output is correct |
27 |
Correct |
3 ms |
1012 KB |
Output is correct |
28 |
Correct |
217 ms |
53572 KB |
Output is correct |
29 |
Correct |
361 ms |
78404 KB |
Output is correct |
30 |
Correct |
512 ms |
106276 KB |
Output is correct |
31 |
Correct |
703 ms |
130124 KB |
Output is correct |
32 |
Correct |
0 ms |
344 KB |
Output is correct |
33 |
Correct |
0 ms |
348 KB |
Output is correct |
34 |
Correct |
0 ms |
348 KB |
Output is correct |
35 |
Correct |
1 ms |
348 KB |
Output is correct |
36 |
Correct |
0 ms |
348 KB |
Output is correct |
37 |
Correct |
0 ms |
348 KB |
Output is correct |
38 |
Correct |
0 ms |
348 KB |
Output is correct |
39 |
Correct |
0 ms |
348 KB |
Output is correct |
40 |
Correct |
0 ms |
348 KB |
Output is correct |
41 |
Correct |
1 ms |
348 KB |
Output is correct |
42 |
Correct |
0 ms |
348 KB |
Output is correct |
43 |
Correct |
1 ms |
604 KB |
Output is correct |
44 |
Correct |
2 ms |
704 KB |
Output is correct |
45 |
Correct |
274 ms |
67060 KB |
Output is correct |
46 |
Correct |
439 ms |
97340 KB |
Output is correct |
47 |
Correct |
444 ms |
96576 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
436 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
1 ms |
348 KB |
Output is correct |
9 |
Correct |
282 ms |
76072 KB |
Output is correct |
10 |
Correct |
17 ms |
8024 KB |
Output is correct |
11 |
Correct |
102 ms |
41552 KB |
Output is correct |
12 |
Correct |
26 ms |
11856 KB |
Output is correct |
13 |
Correct |
33 ms |
11604 KB |
Output is correct |
14 |
Correct |
1 ms |
604 KB |
Output is correct |
15 |
Correct |
1 ms |
604 KB |
Output is correct |
16 |
Correct |
268 ms |
71648 KB |
Output is correct |
17 |
Correct |
1 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 |
0 ms |
348 KB |
Output is correct |
21 |
Correct |
1 ms |
344 KB |
Output is correct |
22 |
Correct |
0 ms |
344 KB |
Output is correct |
23 |
Correct |
727 ms |
131672 KB |
Output is correct |
24 |
Correct |
0 ms |
348 KB |
Output is correct |
25 |
Correct |
2 ms |
1116 KB |
Output is correct |
26 |
Correct |
3 ms |
860 KB |
Output is correct |
27 |
Correct |
3 ms |
1012 KB |
Output is correct |
28 |
Correct |
217 ms |
53572 KB |
Output is correct |
29 |
Correct |
361 ms |
78404 KB |
Output is correct |
30 |
Correct |
512 ms |
106276 KB |
Output is correct |
31 |
Correct |
703 ms |
130124 KB |
Output is correct |
32 |
Correct |
0 ms |
344 KB |
Output is correct |
33 |
Correct |
0 ms |
348 KB |
Output is correct |
34 |
Correct |
0 ms |
348 KB |
Output is correct |
35 |
Correct |
1 ms |
348 KB |
Output is correct |
36 |
Correct |
0 ms |
348 KB |
Output is correct |
37 |
Correct |
0 ms |
348 KB |
Output is correct |
38 |
Correct |
0 ms |
348 KB |
Output is correct |
39 |
Correct |
0 ms |
348 KB |
Output is correct |
40 |
Correct |
0 ms |
348 KB |
Output is correct |
41 |
Correct |
1 ms |
348 KB |
Output is correct |
42 |
Correct |
0 ms |
348 KB |
Output is correct |
43 |
Correct |
1 ms |
604 KB |
Output is correct |
44 |
Correct |
2 ms |
704 KB |
Output is correct |
45 |
Correct |
274 ms |
67060 KB |
Output is correct |
46 |
Correct |
439 ms |
97340 KB |
Output is correct |
47 |
Correct |
444 ms |
96576 KB |
Output is correct |
48 |
Correct |
1 ms |
348 KB |
Output is correct |
49 |
Correct |
0 ms |
348 KB |
Output is correct |
50 |
Correct |
0 ms |
348 KB |
Output is correct |
51 |
Correct |
0 ms |
348 KB |
Output is correct |
52 |
Correct |
0 ms |
348 KB |
Output is correct |
53 |
Correct |
0 ms |
348 KB |
Output is correct |
54 |
Correct |
0 ms |
600 KB |
Output is correct |
55 |
Correct |
759 ms |
125820 KB |
Output is correct |
56 |
Correct |
0 ms |
348 KB |
Output is correct |
57 |
Correct |
3 ms |
1372 KB |
Output is correct |
58 |
Correct |
12 ms |
4444 KB |
Output is correct |
59 |
Correct |
8 ms |
1884 KB |
Output is correct |
60 |
Correct |
302 ms |
64856 KB |
Output is correct |
61 |
Correct |
437 ms |
86840 KB |
Output is correct |
62 |
Correct |
564 ms |
104556 KB |
Output is correct |
63 |
Correct |
725 ms |
125500 KB |
Output is correct |
64 |
Correct |
0 ms |
600 KB |
Output is correct |
65 |
Correct |
0 ms |
348 KB |
Output is correct |
66 |
Correct |
0 ms |
344 KB |
Output is correct |
67 |
Correct |
608 ms |
146868 KB |
Output is correct |
68 |
Correct |
630 ms |
147136 KB |
Output is correct |
69 |
Correct |
594 ms |
148920 KB |
Output is correct |
70 |
Correct |
3 ms |
1116 KB |
Output is correct |
71 |
Correct |
5 ms |
1724 KB |
Output is correct |
72 |
Correct |
286 ms |
63500 KB |
Output is correct |
73 |
Correct |
499 ms |
97336 KB |
Output is correct |
74 |
Correct |
708 ms |
126268 KB |
Output is correct |
75 |
Correct |
716 ms |
135480 KB |
Output is correct |
76 |
Correct |
676 ms |
153144 KB |
Output is correct |
77 |
Correct |
4 ms |
1372 KB |
Output is correct |
78 |
Correct |
8 ms |
1924 KB |
Output is correct |
79 |
Correct |
299 ms |
65352 KB |
Output is correct |
80 |
Correct |
494 ms |
98452 KB |
Output is correct |
81 |
Correct |
719 ms |
131384 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
436 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
1 ms |
348 KB |
Output is correct |
9 |
Correct |
282 ms |
76072 KB |
Output is correct |
10 |
Correct |
17 ms |
8024 KB |
Output is correct |
11 |
Correct |
102 ms |
41552 KB |
Output is correct |
12 |
Correct |
26 ms |
11856 KB |
Output is correct |
13 |
Correct |
33 ms |
11604 KB |
Output is correct |
14 |
Correct |
1 ms |
604 KB |
Output is correct |
15 |
Correct |
1 ms |
604 KB |
Output is correct |
16 |
Correct |
268 ms |
71648 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 |
632 ms |
132940 KB |
Output is correct |
21 |
Correct |
612 ms |
128660 KB |
Output is correct |
22 |
Correct |
628 ms |
126140 KB |
Output is correct |
23 |
Correct |
474 ms |
122772 KB |
Output is correct |
24 |
Correct |
159 ms |
20760 KB |
Output is correct |
25 |
Correct |
249 ms |
26916 KB |
Output is correct |
26 |
Correct |
206 ms |
26960 KB |
Output is correct |
27 |
Correct |
532 ms |
130416 KB |
Output is correct |
28 |
Correct |
558 ms |
130360 KB |
Output is correct |
29 |
Correct |
607 ms |
130416 KB |
Output is correct |
30 |
Correct |
644 ms |
130364 KB |
Output is correct |
31 |
Correct |
0 ms |
348 KB |
Output is correct |
32 |
Correct |
31 ms |
9352 KB |
Output is correct |
33 |
Correct |
75 ms |
10588 KB |
Output is correct |
34 |
Correct |
596 ms |
129336 KB |
Output is correct |
35 |
Correct |
9 ms |
1884 KB |
Output is correct |
36 |
Correct |
47 ms |
7688 KB |
Output is correct |
37 |
Correct |
105 ms |
14184 KB |
Output is correct |
38 |
Correct |
225 ms |
46404 KB |
Output is correct |
39 |
Correct |
329 ms |
63576 KB |
Output is correct |
40 |
Correct |
449 ms |
80680 KB |
Output is correct |
41 |
Correct |
560 ms |
97852 KB |
Output is correct |
42 |
Correct |
700 ms |
115068 KB |
Output is correct |
43 |
Correct |
0 ms |
348 KB |
Output is correct |
44 |
Correct |
0 ms |
348 KB |
Output is correct |
45 |
Correct |
0 ms |
348 KB |
Output is correct |
46 |
Correct |
0 ms |
348 KB |
Output is correct |
47 |
Correct |
1 ms |
348 KB |
Output is correct |
48 |
Correct |
0 ms |
348 KB |
Output is correct |
49 |
Correct |
0 ms |
344 KB |
Output is correct |
50 |
Correct |
0 ms |
348 KB |
Output is correct |
51 |
Correct |
0 ms |
348 KB |
Output is correct |
52 |
Correct |
0 ms |
348 KB |
Output is correct |
53 |
Correct |
0 ms |
348 KB |
Output is correct |
54 |
Correct |
2 ms |
604 KB |
Output is correct |
55 |
Correct |
2 ms |
860 KB |
Output is correct |
56 |
Correct |
281 ms |
66232 KB |
Output is correct |
57 |
Correct |
447 ms |
96632 KB |
Output is correct |
58 |
Correct |
437 ms |
95800 KB |
Output is correct |
59 |
Correct |
0 ms |
344 KB |
Output is correct |
60 |
Correct |
0 ms |
348 KB |
Output is correct |
61 |
Correct |
0 ms |
348 KB |
Output is correct |
62 |
Correct |
611 ms |
145852 KB |
Output is correct |
63 |
Correct |
625 ms |
146240 KB |
Output is correct |
64 |
Correct |
594 ms |
147892 KB |
Output is correct |
65 |
Correct |
3 ms |
1112 KB |
Output is correct |
66 |
Correct |
6 ms |
1624 KB |
Output is correct |
67 |
Correct |
279 ms |
62688 KB |
Output is correct |
68 |
Correct |
490 ms |
96572 KB |
Output is correct |
69 |
Correct |
681 ms |
125244 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
436 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
1 ms |
348 KB |
Output is correct |
9 |
Correct |
282 ms |
76072 KB |
Output is correct |
10 |
Correct |
17 ms |
8024 KB |
Output is correct |
11 |
Correct |
102 ms |
41552 KB |
Output is correct |
12 |
Correct |
26 ms |
11856 KB |
Output is correct |
13 |
Correct |
33 ms |
11604 KB |
Output is correct |
14 |
Correct |
1 ms |
604 KB |
Output is correct |
15 |
Correct |
1 ms |
604 KB |
Output is correct |
16 |
Correct |
268 ms |
71648 KB |
Output is correct |
17 |
Correct |
608 ms |
152128 KB |
Output is correct |
18 |
Correct |
563 ms |
143296 KB |
Output is correct |
19 |
Correct |
639 ms |
133388 KB |
Output is correct |
20 |
Correct |
696 ms |
120636 KB |
Output is correct |
21 |
Correct |
576 ms |
116280 KB |
Output is correct |
22 |
Correct |
0 ms |
348 KB |
Output is correct |
23 |
Correct |
78 ms |
19260 KB |
Output is correct |
24 |
Correct |
19 ms |
3848 KB |
Output is correct |
25 |
Correct |
71 ms |
10396 KB |
Output is correct |
26 |
Correct |
129 ms |
17508 KB |
Output is correct |
27 |
Correct |
314 ms |
62016 KB |
Output is correct |
28 |
Correct |
416 ms |
76756 KB |
Output is correct |
29 |
Correct |
506 ms |
93008 KB |
Output is correct |
30 |
Correct |
607 ms |
108348 KB |
Output is correct |
31 |
Correct |
696 ms |
122520 KB |
Output is correct |
32 |
Correct |
679 ms |
134436 KB |
Output is correct |
33 |
Correct |
621 ms |
152124 KB |
Output is correct |
34 |
Correct |
4 ms |
1624 KB |
Output is correct |
35 |
Correct |
7 ms |
1884 KB |
Output is correct |
36 |
Correct |
294 ms |
64440 KB |
Output is correct |
37 |
Correct |
498 ms |
97260 KB |
Output is correct |
38 |
Correct |
696 ms |
130300 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
436 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
1 ms |
348 KB |
Output is correct |
9 |
Correct |
282 ms |
76072 KB |
Output is correct |
10 |
Correct |
17 ms |
8024 KB |
Output is correct |
11 |
Correct |
102 ms |
41552 KB |
Output is correct |
12 |
Correct |
26 ms |
11856 KB |
Output is correct |
13 |
Correct |
33 ms |
11604 KB |
Output is correct |
14 |
Correct |
1 ms |
604 KB |
Output is correct |
15 |
Correct |
1 ms |
604 KB |
Output is correct |
16 |
Correct |
268 ms |
71648 KB |
Output is correct |
17 |
Correct |
1 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 |
0 ms |
348 KB |
Output is correct |
21 |
Correct |
1 ms |
344 KB |
Output is correct |
22 |
Correct |
0 ms |
344 KB |
Output is correct |
23 |
Correct |
727 ms |
131672 KB |
Output is correct |
24 |
Correct |
0 ms |
348 KB |
Output is correct |
25 |
Correct |
2 ms |
1116 KB |
Output is correct |
26 |
Correct |
3 ms |
860 KB |
Output is correct |
27 |
Correct |
3 ms |
1012 KB |
Output is correct |
28 |
Correct |
217 ms |
53572 KB |
Output is correct |
29 |
Correct |
361 ms |
78404 KB |
Output is correct |
30 |
Correct |
512 ms |
106276 KB |
Output is correct |
31 |
Correct |
703 ms |
130124 KB |
Output is correct |
32 |
Correct |
0 ms |
344 KB |
Output is correct |
33 |
Correct |
0 ms |
348 KB |
Output is correct |
34 |
Correct |
0 ms |
348 KB |
Output is correct |
35 |
Correct |
1 ms |
348 KB |
Output is correct |
36 |
Correct |
0 ms |
348 KB |
Output is correct |
37 |
Correct |
0 ms |
348 KB |
Output is correct |
38 |
Correct |
0 ms |
348 KB |
Output is correct |
39 |
Correct |
0 ms |
348 KB |
Output is correct |
40 |
Correct |
0 ms |
348 KB |
Output is correct |
41 |
Correct |
1 ms |
348 KB |
Output is correct |
42 |
Correct |
0 ms |
348 KB |
Output is correct |
43 |
Correct |
1 ms |
604 KB |
Output is correct |
44 |
Correct |
2 ms |
704 KB |
Output is correct |
45 |
Correct |
274 ms |
67060 KB |
Output is correct |
46 |
Correct |
439 ms |
97340 KB |
Output is correct |
47 |
Correct |
444 ms |
96576 KB |
Output is correct |
48 |
Correct |
1 ms |
348 KB |
Output is correct |
49 |
Correct |
0 ms |
348 KB |
Output is correct |
50 |
Correct |
0 ms |
348 KB |
Output is correct |
51 |
Correct |
0 ms |
348 KB |
Output is correct |
52 |
Correct |
0 ms |
348 KB |
Output is correct |
53 |
Correct |
0 ms |
348 KB |
Output is correct |
54 |
Correct |
0 ms |
600 KB |
Output is correct |
55 |
Correct |
759 ms |
125820 KB |
Output is correct |
56 |
Correct |
0 ms |
348 KB |
Output is correct |
57 |
Correct |
3 ms |
1372 KB |
Output is correct |
58 |
Correct |
12 ms |
4444 KB |
Output is correct |
59 |
Correct |
8 ms |
1884 KB |
Output is correct |
60 |
Correct |
302 ms |
64856 KB |
Output is correct |
61 |
Correct |
437 ms |
86840 KB |
Output is correct |
62 |
Correct |
564 ms |
104556 KB |
Output is correct |
63 |
Correct |
725 ms |
125500 KB |
Output is correct |
64 |
Correct |
0 ms |
600 KB |
Output is correct |
65 |
Correct |
0 ms |
348 KB |
Output is correct |
66 |
Correct |
0 ms |
344 KB |
Output is correct |
67 |
Correct |
608 ms |
146868 KB |
Output is correct |
68 |
Correct |
630 ms |
147136 KB |
Output is correct |
69 |
Correct |
594 ms |
148920 KB |
Output is correct |
70 |
Correct |
3 ms |
1116 KB |
Output is correct |
71 |
Correct |
5 ms |
1724 KB |
Output is correct |
72 |
Correct |
286 ms |
63500 KB |
Output is correct |
73 |
Correct |
499 ms |
97336 KB |
Output is correct |
74 |
Correct |
708 ms |
126268 KB |
Output is correct |
75 |
Correct |
716 ms |
135480 KB |
Output is correct |
76 |
Correct |
676 ms |
153144 KB |
Output is correct |
77 |
Correct |
4 ms |
1372 KB |
Output is correct |
78 |
Correct |
8 ms |
1924 KB |
Output is correct |
79 |
Correct |
299 ms |
65352 KB |
Output is correct |
80 |
Correct |
494 ms |
98452 KB |
Output is correct |
81 |
Correct |
719 ms |
131384 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 |
632 ms |
132940 KB |
Output is correct |
86 |
Correct |
612 ms |
128660 KB |
Output is correct |
87 |
Correct |
628 ms |
126140 KB |
Output is correct |
88 |
Correct |
474 ms |
122772 KB |
Output is correct |
89 |
Correct |
159 ms |
20760 KB |
Output is correct |
90 |
Correct |
249 ms |
26916 KB |
Output is correct |
91 |
Correct |
206 ms |
26960 KB |
Output is correct |
92 |
Correct |
532 ms |
130416 KB |
Output is correct |
93 |
Correct |
558 ms |
130360 KB |
Output is correct |
94 |
Correct |
607 ms |
130416 KB |
Output is correct |
95 |
Correct |
644 ms |
130364 KB |
Output is correct |
96 |
Correct |
0 ms |
348 KB |
Output is correct |
97 |
Correct |
31 ms |
9352 KB |
Output is correct |
98 |
Correct |
75 ms |
10588 KB |
Output is correct |
99 |
Correct |
596 ms |
129336 KB |
Output is correct |
100 |
Correct |
9 ms |
1884 KB |
Output is correct |
101 |
Correct |
47 ms |
7688 KB |
Output is correct |
102 |
Correct |
105 ms |
14184 KB |
Output is correct |
103 |
Correct |
225 ms |
46404 KB |
Output is correct |
104 |
Correct |
329 ms |
63576 KB |
Output is correct |
105 |
Correct |
449 ms |
80680 KB |
Output is correct |
106 |
Correct |
560 ms |
97852 KB |
Output is correct |
107 |
Correct |
700 ms |
115068 KB |
Output is correct |
108 |
Correct |
0 ms |
348 KB |
Output is correct |
109 |
Correct |
0 ms |
348 KB |
Output is correct |
110 |
Correct |
0 ms |
348 KB |
Output is correct |
111 |
Correct |
0 ms |
348 KB |
Output is correct |
112 |
Correct |
1 ms |
348 KB |
Output is correct |
113 |
Correct |
0 ms |
348 KB |
Output is correct |
114 |
Correct |
0 ms |
344 KB |
Output is correct |
115 |
Correct |
0 ms |
348 KB |
Output is correct |
116 |
Correct |
0 ms |
348 KB |
Output is correct |
117 |
Correct |
0 ms |
348 KB |
Output is correct |
118 |
Correct |
0 ms |
348 KB |
Output is correct |
119 |
Correct |
2 ms |
604 KB |
Output is correct |
120 |
Correct |
2 ms |
860 KB |
Output is correct |
121 |
Correct |
281 ms |
66232 KB |
Output is correct |
122 |
Correct |
447 ms |
96632 KB |
Output is correct |
123 |
Correct |
437 ms |
95800 KB |
Output is correct |
124 |
Correct |
0 ms |
344 KB |
Output is correct |
125 |
Correct |
0 ms |
348 KB |
Output is correct |
126 |
Correct |
0 ms |
348 KB |
Output is correct |
127 |
Correct |
611 ms |
145852 KB |
Output is correct |
128 |
Correct |
625 ms |
146240 KB |
Output is correct |
129 |
Correct |
594 ms |
147892 KB |
Output is correct |
130 |
Correct |
3 ms |
1112 KB |
Output is correct |
131 |
Correct |
6 ms |
1624 KB |
Output is correct |
132 |
Correct |
279 ms |
62688 KB |
Output is correct |
133 |
Correct |
490 ms |
96572 KB |
Output is correct |
134 |
Correct |
681 ms |
125244 KB |
Output is correct |
135 |
Correct |
608 ms |
152128 KB |
Output is correct |
136 |
Correct |
563 ms |
143296 KB |
Output is correct |
137 |
Correct |
639 ms |
133388 KB |
Output is correct |
138 |
Correct |
696 ms |
120636 KB |
Output is correct |
139 |
Correct |
576 ms |
116280 KB |
Output is correct |
140 |
Correct |
0 ms |
348 KB |
Output is correct |
141 |
Correct |
78 ms |
19260 KB |
Output is correct |
142 |
Correct |
19 ms |
3848 KB |
Output is correct |
143 |
Correct |
71 ms |
10396 KB |
Output is correct |
144 |
Correct |
129 ms |
17508 KB |
Output is correct |
145 |
Correct |
314 ms |
62016 KB |
Output is correct |
146 |
Correct |
416 ms |
76756 KB |
Output is correct |
147 |
Correct |
506 ms |
93008 KB |
Output is correct |
148 |
Correct |
607 ms |
108348 KB |
Output is correct |
149 |
Correct |
696 ms |
122520 KB |
Output is correct |
150 |
Correct |
679 ms |
134436 KB |
Output is correct |
151 |
Correct |
621 ms |
152124 KB |
Output is correct |
152 |
Correct |
4 ms |
1624 KB |
Output is correct |
153 |
Correct |
7 ms |
1884 KB |
Output is correct |
154 |
Correct |
294 ms |
64440 KB |
Output is correct |
155 |
Correct |
498 ms |
97260 KB |
Output is correct |
156 |
Correct |
696 ms |
130300 KB |
Output is correct |
157 |
Correct |
0 ms |
344 KB |
Output is correct |
158 |
Correct |
0 ms |
348 KB |
Output is correct |
159 |
Correct |
0 ms |
348 KB |
Output is correct |
160 |
Correct |
0 ms |
348 KB |
Output is correct |
161 |
Incorrect |
789 ms |
119300 KB |
Tree @(1791, 1573) appears more than once: for edges on positions 368 and 372 |
162 |
Halted |
0 ms |
0 KB |
- |