#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) {
reverse(g[u].begin(), g[u].end());
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:51:15: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
51 | if(us.size() != n-1) {
| ~~~~~~~~~~^~~~~~
# |
결과 |
실행 시간 |
메모리 |
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 |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
265 ms |
75380 KB |
Output is correct |
10 |
Correct |
16 ms |
8024 KB |
Output is correct |
11 |
Correct |
105 ms |
41136 KB |
Output is correct |
12 |
Correct |
24 ms |
11608 KB |
Output is correct |
13 |
Correct |
31 ms |
11284 KB |
Output is correct |
14 |
Correct |
1 ms |
604 KB |
Output is correct |
15 |
Correct |
1 ms |
604 KB |
Output is correct |
16 |
Correct |
278 ms |
70980 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
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 |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
265 ms |
75380 KB |
Output is correct |
10 |
Correct |
16 ms |
8024 KB |
Output is correct |
11 |
Correct |
105 ms |
41136 KB |
Output is correct |
12 |
Correct |
24 ms |
11608 KB |
Output is correct |
13 |
Correct |
31 ms |
11284 KB |
Output is correct |
14 |
Correct |
1 ms |
604 KB |
Output is correct |
15 |
Correct |
1 ms |
604 KB |
Output is correct |
16 |
Correct |
278 ms |
70980 KB |
Output is correct |
17 |
Correct |
1 ms |
348 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 |
0 ms |
348 KB |
Output is correct |
22 |
Correct |
0 ms |
344 KB |
Output is correct |
23 |
Correct |
705 ms |
131340 KB |
Output is correct |
24 |
Correct |
0 ms |
344 KB |
Output is correct |
25 |
Correct |
2 ms |
1116 KB |
Output is correct |
26 |
Correct |
2 ms |
976 KB |
Output is correct |
27 |
Correct |
3 ms |
860 KB |
Output is correct |
28 |
Correct |
224 ms |
53044 KB |
Output is correct |
29 |
Correct |
363 ms |
82260 KB |
Output is correct |
30 |
Correct |
519 ms |
112672 KB |
Output is correct |
31 |
Correct |
718 ms |
130348 KB |
Output is correct |
32 |
Correct |
1 ms |
600 KB |
Output is correct |
33 |
Correct |
0 ms |
348 KB |
Output is correct |
34 |
Correct |
0 ms |
348 KB |
Output is correct |
35 |
Correct |
0 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 |
860 KB |
Output is correct |
45 |
Correct |
276 ms |
66316 KB |
Output is correct |
46 |
Correct |
417 ms |
96576 KB |
Output is correct |
47 |
Correct |
429 ms |
95800 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
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 |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
265 ms |
75380 KB |
Output is correct |
10 |
Correct |
16 ms |
8024 KB |
Output is correct |
11 |
Correct |
105 ms |
41136 KB |
Output is correct |
12 |
Correct |
24 ms |
11608 KB |
Output is correct |
13 |
Correct |
31 ms |
11284 KB |
Output is correct |
14 |
Correct |
1 ms |
604 KB |
Output is correct |
15 |
Correct |
1 ms |
604 KB |
Output is correct |
16 |
Correct |
278 ms |
70980 KB |
Output is correct |
17 |
Correct |
1 ms |
348 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 |
0 ms |
348 KB |
Output is correct |
22 |
Correct |
0 ms |
344 KB |
Output is correct |
23 |
Correct |
705 ms |
131340 KB |
Output is correct |
24 |
Correct |
0 ms |
344 KB |
Output is correct |
25 |
Correct |
2 ms |
1116 KB |
Output is correct |
26 |
Correct |
2 ms |
976 KB |
Output is correct |
27 |
Correct |
3 ms |
860 KB |
Output is correct |
28 |
Correct |
224 ms |
53044 KB |
Output is correct |
29 |
Correct |
363 ms |
82260 KB |
Output is correct |
30 |
Correct |
519 ms |
112672 KB |
Output is correct |
31 |
Correct |
718 ms |
130348 KB |
Output is correct |
32 |
Correct |
1 ms |
600 KB |
Output is correct |
33 |
Correct |
0 ms |
348 KB |
Output is correct |
34 |
Correct |
0 ms |
348 KB |
Output is correct |
35 |
Correct |
0 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 |
860 KB |
Output is correct |
45 |
Correct |
276 ms |
66316 KB |
Output is correct |
46 |
Correct |
417 ms |
96576 KB |
Output is correct |
47 |
Correct |
429 ms |
95800 KB |
Output is correct |
48 |
Correct |
1 ms |
344 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 |
0 ms |
348 KB |
Output is correct |
55 |
Correct |
744 ms |
126264 KB |
Output is correct |
56 |
Correct |
0 ms |
348 KB |
Output is correct |
57 |
Correct |
3 ms |
1516 KB |
Output is correct |
58 |
Correct |
14 ms |
4184 KB |
Output is correct |
59 |
Correct |
8 ms |
1920 KB |
Output is correct |
60 |
Correct |
308 ms |
66772 KB |
Output is correct |
61 |
Correct |
446 ms |
86852 KB |
Output is correct |
62 |
Correct |
573 ms |
104764 KB |
Output is correct |
63 |
Correct |
739 ms |
128300 KB |
Output is correct |
64 |
Correct |
0 ms |
348 KB |
Output is correct |
65 |
Correct |
0 ms |
344 KB |
Output is correct |
66 |
Correct |
0 ms |
348 KB |
Output is correct |
67 |
Correct |
594 ms |
145964 KB |
Output is correct |
68 |
Correct |
621 ms |
146324 KB |
Output is correct |
69 |
Correct |
596 ms |
148040 KB |
Output is correct |
70 |
Correct |
3 ms |
1116 KB |
Output is correct |
71 |
Correct |
5 ms |
1628 KB |
Output is correct |
72 |
Correct |
292 ms |
62788 KB |
Output is correct |
73 |
Correct |
496 ms |
96564 KB |
Output is correct |
74 |
Correct |
722 ms |
125244 KB |
Output is correct |
75 |
Correct |
645 ms |
139836 KB |
Output is correct |
76 |
Correct |
610 ms |
152188 KB |
Output is correct |
77 |
Correct |
4 ms |
1372 KB |
Output is correct |
78 |
Correct |
9 ms |
1848 KB |
Output is correct |
79 |
Correct |
295 ms |
64580 KB |
Output is correct |
80 |
Correct |
519 ms |
97480 KB |
Output is correct |
81 |
Correct |
699 ms |
129212 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
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 |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
265 ms |
75380 KB |
Output is correct |
10 |
Correct |
16 ms |
8024 KB |
Output is correct |
11 |
Correct |
105 ms |
41136 KB |
Output is correct |
12 |
Correct |
24 ms |
11608 KB |
Output is correct |
13 |
Correct |
31 ms |
11284 KB |
Output is correct |
14 |
Correct |
1 ms |
604 KB |
Output is correct |
15 |
Correct |
1 ms |
604 KB |
Output is correct |
16 |
Correct |
278 ms |
70980 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 |
648 ms |
132864 KB |
Output is correct |
21 |
Correct |
599 ms |
128828 KB |
Output is correct |
22 |
Correct |
599 ms |
126268 KB |
Output is correct |
23 |
Correct |
475 ms |
122768 KB |
Output is correct |
24 |
Correct |
162 ms |
20748 KB |
Output is correct |
25 |
Correct |
243 ms |
26960 KB |
Output is correct |
26 |
Correct |
202 ms |
27216 KB |
Output is correct |
27 |
Correct |
546 ms |
130408 KB |
Output is correct |
28 |
Correct |
568 ms |
130232 KB |
Output is correct |
29 |
Correct |
638 ms |
130364 KB |
Output is correct |
30 |
Correct |
653 ms |
130364 KB |
Output is correct |
31 |
Correct |
0 ms |
348 KB |
Output is correct |
32 |
Correct |
31 ms |
9172 KB |
Output is correct |
33 |
Correct |
82 ms |
10596 KB |
Output is correct |
34 |
Correct |
622 ms |
129340 KB |
Output is correct |
35 |
Correct |
9 ms |
1884 KB |
Output is correct |
36 |
Correct |
48 ms |
7636 KB |
Output is correct |
37 |
Correct |
104 ms |
14172 KB |
Output is correct |
38 |
Correct |
216 ms |
46348 KB |
Output is correct |
39 |
Correct |
321 ms |
63552 KB |
Output is correct |
40 |
Correct |
441 ms |
80956 KB |
Output is correct |
41 |
Correct |
580 ms |
97844 KB |
Output is correct |
42 |
Correct |
712 ms |
115260 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 |
600 KB |
Output is correct |
47 |
Correct |
0 ms |
348 KB |
Output is correct |
48 |
Correct |
0 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 |
1 ms |
604 KB |
Output is correct |
55 |
Correct |
2 ms |
860 KB |
Output is correct |
56 |
Correct |
281 ms |
66124 KB |
Output is correct |
57 |
Correct |
448 ms |
96536 KB |
Output is correct |
58 |
Correct |
424 ms |
95848 KB |
Output is correct |
59 |
Correct |
0 ms |
344 KB |
Output is correct |
60 |
Correct |
0 ms |
344 KB |
Output is correct |
61 |
Correct |
0 ms |
348 KB |
Output is correct |
62 |
Correct |
574 ms |
145760 KB |
Output is correct |
63 |
Correct |
614 ms |
146232 KB |
Output is correct |
64 |
Correct |
588 ms |
148024 KB |
Output is correct |
65 |
Correct |
3 ms |
1112 KB |
Output is correct |
66 |
Correct |
5 ms |
1628 KB |
Output is correct |
67 |
Correct |
285 ms |
62684 KB |
Output is correct |
68 |
Correct |
502 ms |
96568 KB |
Output is correct |
69 |
Correct |
708 ms |
125240 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
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 |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
265 ms |
75380 KB |
Output is correct |
10 |
Correct |
16 ms |
8024 KB |
Output is correct |
11 |
Correct |
105 ms |
41136 KB |
Output is correct |
12 |
Correct |
24 ms |
11608 KB |
Output is correct |
13 |
Correct |
31 ms |
11284 KB |
Output is correct |
14 |
Correct |
1 ms |
604 KB |
Output is correct |
15 |
Correct |
1 ms |
604 KB |
Output is correct |
16 |
Correct |
278 ms |
70980 KB |
Output is correct |
17 |
Correct |
617 ms |
152124 KB |
Output is correct |
18 |
Correct |
605 ms |
149956 KB |
Output is correct |
19 |
Correct |
612 ms |
133420 KB |
Output is correct |
20 |
Correct |
683 ms |
119424 KB |
Output is correct |
21 |
Correct |
584 ms |
115500 KB |
Output is correct |
22 |
Correct |
1 ms |
344 KB |
Output is correct |
23 |
Correct |
73 ms |
19024 KB |
Output is correct |
24 |
Correct |
20 ms |
3932 KB |
Output is correct |
25 |
Correct |
72 ms |
10692 KB |
Output is correct |
26 |
Correct |
125 ms |
17232 KB |
Output is correct |
27 |
Correct |
295 ms |
62220 KB |
Output is correct |
28 |
Correct |
392 ms |
77888 KB |
Output is correct |
29 |
Correct |
501 ms |
92984 KB |
Output is correct |
30 |
Correct |
652 ms |
107320 KB |
Output is correct |
31 |
Correct |
710 ms |
123964 KB |
Output is correct |
32 |
Correct |
648 ms |
139820 KB |
Output is correct |
33 |
Correct |
594 ms |
152376 KB |
Output is correct |
34 |
Correct |
4 ms |
1368 KB |
Output is correct |
35 |
Correct |
7 ms |
1880 KB |
Output is correct |
36 |
Correct |
274 ms |
64580 KB |
Output is correct |
37 |
Correct |
506 ms |
97340 KB |
Output is correct |
38 |
Correct |
680 ms |
129340 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
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 |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
265 ms |
75380 KB |
Output is correct |
10 |
Correct |
16 ms |
8024 KB |
Output is correct |
11 |
Correct |
105 ms |
41136 KB |
Output is correct |
12 |
Correct |
24 ms |
11608 KB |
Output is correct |
13 |
Correct |
31 ms |
11284 KB |
Output is correct |
14 |
Correct |
1 ms |
604 KB |
Output is correct |
15 |
Correct |
1 ms |
604 KB |
Output is correct |
16 |
Correct |
278 ms |
70980 KB |
Output is correct |
17 |
Correct |
1 ms |
348 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 |
0 ms |
348 KB |
Output is correct |
22 |
Correct |
0 ms |
344 KB |
Output is correct |
23 |
Correct |
705 ms |
131340 KB |
Output is correct |
24 |
Correct |
0 ms |
344 KB |
Output is correct |
25 |
Correct |
2 ms |
1116 KB |
Output is correct |
26 |
Correct |
2 ms |
976 KB |
Output is correct |
27 |
Correct |
3 ms |
860 KB |
Output is correct |
28 |
Correct |
224 ms |
53044 KB |
Output is correct |
29 |
Correct |
363 ms |
82260 KB |
Output is correct |
30 |
Correct |
519 ms |
112672 KB |
Output is correct |
31 |
Correct |
718 ms |
130348 KB |
Output is correct |
32 |
Correct |
1 ms |
600 KB |
Output is correct |
33 |
Correct |
0 ms |
348 KB |
Output is correct |
34 |
Correct |
0 ms |
348 KB |
Output is correct |
35 |
Correct |
0 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 |
860 KB |
Output is correct |
45 |
Correct |
276 ms |
66316 KB |
Output is correct |
46 |
Correct |
417 ms |
96576 KB |
Output is correct |
47 |
Correct |
429 ms |
95800 KB |
Output is correct |
48 |
Correct |
1 ms |
344 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 |
0 ms |
348 KB |
Output is correct |
55 |
Correct |
744 ms |
126264 KB |
Output is correct |
56 |
Correct |
0 ms |
348 KB |
Output is correct |
57 |
Correct |
3 ms |
1516 KB |
Output is correct |
58 |
Correct |
14 ms |
4184 KB |
Output is correct |
59 |
Correct |
8 ms |
1920 KB |
Output is correct |
60 |
Correct |
308 ms |
66772 KB |
Output is correct |
61 |
Correct |
446 ms |
86852 KB |
Output is correct |
62 |
Correct |
573 ms |
104764 KB |
Output is correct |
63 |
Correct |
739 ms |
128300 KB |
Output is correct |
64 |
Correct |
0 ms |
348 KB |
Output is correct |
65 |
Correct |
0 ms |
344 KB |
Output is correct |
66 |
Correct |
0 ms |
348 KB |
Output is correct |
67 |
Correct |
594 ms |
145964 KB |
Output is correct |
68 |
Correct |
621 ms |
146324 KB |
Output is correct |
69 |
Correct |
596 ms |
148040 KB |
Output is correct |
70 |
Correct |
3 ms |
1116 KB |
Output is correct |
71 |
Correct |
5 ms |
1628 KB |
Output is correct |
72 |
Correct |
292 ms |
62788 KB |
Output is correct |
73 |
Correct |
496 ms |
96564 KB |
Output is correct |
74 |
Correct |
722 ms |
125244 KB |
Output is correct |
75 |
Correct |
645 ms |
139836 KB |
Output is correct |
76 |
Correct |
610 ms |
152188 KB |
Output is correct |
77 |
Correct |
4 ms |
1372 KB |
Output is correct |
78 |
Correct |
9 ms |
1848 KB |
Output is correct |
79 |
Correct |
295 ms |
64580 KB |
Output is correct |
80 |
Correct |
519 ms |
97480 KB |
Output is correct |
81 |
Correct |
699 ms |
129212 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 |
648 ms |
132864 KB |
Output is correct |
86 |
Correct |
599 ms |
128828 KB |
Output is correct |
87 |
Correct |
599 ms |
126268 KB |
Output is correct |
88 |
Correct |
475 ms |
122768 KB |
Output is correct |
89 |
Correct |
162 ms |
20748 KB |
Output is correct |
90 |
Correct |
243 ms |
26960 KB |
Output is correct |
91 |
Correct |
202 ms |
27216 KB |
Output is correct |
92 |
Correct |
546 ms |
130408 KB |
Output is correct |
93 |
Correct |
568 ms |
130232 KB |
Output is correct |
94 |
Correct |
638 ms |
130364 KB |
Output is correct |
95 |
Correct |
653 ms |
130364 KB |
Output is correct |
96 |
Correct |
0 ms |
348 KB |
Output is correct |
97 |
Correct |
31 ms |
9172 KB |
Output is correct |
98 |
Correct |
82 ms |
10596 KB |
Output is correct |
99 |
Correct |
622 ms |
129340 KB |
Output is correct |
100 |
Correct |
9 ms |
1884 KB |
Output is correct |
101 |
Correct |
48 ms |
7636 KB |
Output is correct |
102 |
Correct |
104 ms |
14172 KB |
Output is correct |
103 |
Correct |
216 ms |
46348 KB |
Output is correct |
104 |
Correct |
321 ms |
63552 KB |
Output is correct |
105 |
Correct |
441 ms |
80956 KB |
Output is correct |
106 |
Correct |
580 ms |
97844 KB |
Output is correct |
107 |
Correct |
712 ms |
115260 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 |
600 KB |
Output is correct |
112 |
Correct |
0 ms |
348 KB |
Output is correct |
113 |
Correct |
0 ms |
348 KB |
Output is correct |
114 |
Correct |
0 ms |
348 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 |
1 ms |
604 KB |
Output is correct |
120 |
Correct |
2 ms |
860 KB |
Output is correct |
121 |
Correct |
281 ms |
66124 KB |
Output is correct |
122 |
Correct |
448 ms |
96536 KB |
Output is correct |
123 |
Correct |
424 ms |
95848 KB |
Output is correct |
124 |
Correct |
0 ms |
344 KB |
Output is correct |
125 |
Correct |
0 ms |
344 KB |
Output is correct |
126 |
Correct |
0 ms |
348 KB |
Output is correct |
127 |
Correct |
574 ms |
145760 KB |
Output is correct |
128 |
Correct |
614 ms |
146232 KB |
Output is correct |
129 |
Correct |
588 ms |
148024 KB |
Output is correct |
130 |
Correct |
3 ms |
1112 KB |
Output is correct |
131 |
Correct |
5 ms |
1628 KB |
Output is correct |
132 |
Correct |
285 ms |
62684 KB |
Output is correct |
133 |
Correct |
502 ms |
96568 KB |
Output is correct |
134 |
Correct |
708 ms |
125240 KB |
Output is correct |
135 |
Correct |
617 ms |
152124 KB |
Output is correct |
136 |
Correct |
605 ms |
149956 KB |
Output is correct |
137 |
Correct |
612 ms |
133420 KB |
Output is correct |
138 |
Correct |
683 ms |
119424 KB |
Output is correct |
139 |
Correct |
584 ms |
115500 KB |
Output is correct |
140 |
Correct |
1 ms |
344 KB |
Output is correct |
141 |
Correct |
73 ms |
19024 KB |
Output is correct |
142 |
Correct |
20 ms |
3932 KB |
Output is correct |
143 |
Correct |
72 ms |
10692 KB |
Output is correct |
144 |
Correct |
125 ms |
17232 KB |
Output is correct |
145 |
Correct |
295 ms |
62220 KB |
Output is correct |
146 |
Correct |
392 ms |
77888 KB |
Output is correct |
147 |
Correct |
501 ms |
92984 KB |
Output is correct |
148 |
Correct |
652 ms |
107320 KB |
Output is correct |
149 |
Correct |
710 ms |
123964 KB |
Output is correct |
150 |
Correct |
648 ms |
139820 KB |
Output is correct |
151 |
Correct |
594 ms |
152376 KB |
Output is correct |
152 |
Correct |
4 ms |
1368 KB |
Output is correct |
153 |
Correct |
7 ms |
1880 KB |
Output is correct |
154 |
Correct |
274 ms |
64580 KB |
Output is correct |
155 |
Correct |
506 ms |
97340 KB |
Output is correct |
156 |
Correct |
680 ms |
129340 KB |
Output is correct |
157 |
Correct |
1 ms |
348 KB |
Output is correct |
158 |
Correct |
0 ms |
348 KB |
Output is correct |
159 |
Correct |
1 ms |
348 KB |
Output is correct |
160 |
Correct |
0 ms |
348 KB |
Output is correct |
161 |
Incorrect |
770 ms |
120488 KB |
Tree @(1771, 1403) appears more than once: for edges on positions 168 and 169 |
162 |
Halted |
0 ms |
0 KB |
- |