Submission #997037

# Submission time Handle Problem Language Result Execution time Memory
997037 2024-06-11T15:53:32 Z 0npata Fountain Parks (IOI21_parks) C++17
70 / 100
776 ms 154172 KB
#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(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 436 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 0 ms 344 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 436 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 291 ms 76356 KB Output is correct
10 Correct 17 ms 8028 KB Output is correct
11 Correct 114 ms 41736 KB Output is correct
12 Correct 28 ms 11856 KB Output is correct
13 Correct 32 ms 11604 KB Output is correct
14 Correct 1 ms 600 KB Output is correct
15 Correct 1 ms 800 KB Output is correct
16 Correct 284 ms 71688 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 436 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 0 ms 344 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 436 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 291 ms 76356 KB Output is correct
10 Correct 17 ms 8028 KB Output is correct
11 Correct 114 ms 41736 KB Output is correct
12 Correct 28 ms 11856 KB Output is correct
13 Correct 32 ms 11604 KB Output is correct
14 Correct 1 ms 600 KB Output is correct
15 Correct 1 ms 800 KB Output is correct
16 Correct 284 ms 71688 KB Output is correct
17 Correct 0 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 344 KB Output is correct
21 Correct 0 ms 348 KB Output is correct
22 Correct 0 ms 344 KB Output is correct
23 Correct 693 ms 132240 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 856 KB Output is correct
27 Correct 3 ms 860 KB Output is correct
28 Correct 224 ms 53596 KB Output is correct
29 Correct 321 ms 78664 KB Output is correct
30 Correct 502 ms 106660 KB Output is correct
31 Correct 643 ms 130620 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 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 1 ms 344 KB Output is correct
39 Correct 0 ms 348 KB Output is correct
40 Correct 0 ms 344 KB Output is correct
41 Correct 0 ms 344 KB Output is correct
42 Correct 0 ms 348 KB Output is correct
43 Correct 2 ms 604 KB Output is correct
44 Correct 2 ms 860 KB Output is correct
45 Correct 270 ms 66980 KB Output is correct
46 Correct 402 ms 97848 KB Output is correct
47 Correct 434 ms 97088 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 436 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 0 ms 344 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 436 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 291 ms 76356 KB Output is correct
10 Correct 17 ms 8028 KB Output is correct
11 Correct 114 ms 41736 KB Output is correct
12 Correct 28 ms 11856 KB Output is correct
13 Correct 32 ms 11604 KB Output is correct
14 Correct 1 ms 600 KB Output is correct
15 Correct 1 ms 800 KB Output is correct
16 Correct 284 ms 71688 KB Output is correct
17 Correct 0 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 344 KB Output is correct
21 Correct 0 ms 348 KB Output is correct
22 Correct 0 ms 344 KB Output is correct
23 Correct 693 ms 132240 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 856 KB Output is correct
27 Correct 3 ms 860 KB Output is correct
28 Correct 224 ms 53596 KB Output is correct
29 Correct 321 ms 78664 KB Output is correct
30 Correct 502 ms 106660 KB Output is correct
31 Correct 643 ms 130620 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 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 1 ms 344 KB Output is correct
39 Correct 0 ms 348 KB Output is correct
40 Correct 0 ms 344 KB Output is correct
41 Correct 0 ms 344 KB Output is correct
42 Correct 0 ms 348 KB Output is correct
43 Correct 2 ms 604 KB Output is correct
44 Correct 2 ms 860 KB Output is correct
45 Correct 270 ms 66980 KB Output is correct
46 Correct 402 ms 97848 KB Output is correct
47 Correct 434 ms 97088 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 428 KB Output is correct
54 Correct 0 ms 348 KB Output is correct
55 Correct 694 ms 126276 KB Output is correct
56 Correct 1 ms 348 KB Output is correct
57 Correct 4 ms 1372 KB Output is correct
58 Correct 13 ms 4224 KB Output is correct
59 Correct 8 ms 1884 KB Output is correct
60 Correct 285 ms 65060 KB Output is correct
61 Correct 441 ms 87100 KB Output is correct
62 Correct 560 ms 105020 KB Output is correct
63 Correct 709 ms 126276 KB Output is correct
64 Correct 0 ms 344 KB Output is correct
65 Correct 1 ms 344 KB Output is correct
66 Correct 0 ms 348 KB Output is correct
67 Correct 607 ms 147516 KB Output is correct
68 Correct 625 ms 147944 KB Output is correct
69 Correct 611 ms 149816 KB Output is correct
70 Correct 3 ms 1116 KB Output is correct
71 Correct 6 ms 1628 KB Output is correct
72 Correct 280 ms 63464 KB Output is correct
73 Correct 468 ms 97852 KB Output is correct
74 Correct 706 ms 127036 KB Output is correct
75 Correct 641 ms 136248 KB Output is correct
76 Correct 656 ms 153912 KB Output is correct
77 Correct 4 ms 1372 KB Output is correct
78 Correct 7 ms 2140 KB Output is correct
79 Correct 289 ms 65192 KB Output is correct
80 Correct 487 ms 98616 KB Output is correct
81 Correct 772 ms 131900 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 436 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 0 ms 344 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 436 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 291 ms 76356 KB Output is correct
10 Correct 17 ms 8028 KB Output is correct
11 Correct 114 ms 41736 KB Output is correct
12 Correct 28 ms 11856 KB Output is correct
13 Correct 32 ms 11604 KB Output is correct
14 Correct 1 ms 600 KB Output is correct
15 Correct 1 ms 800 KB Output is correct
16 Correct 284 ms 71688 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 1 ms 348 KB Output is correct
20 Correct 651 ms 135600 KB Output is correct
21 Correct 776 ms 131132 KB Output is correct
22 Correct 761 ms 128684 KB Output is correct
23 Correct 641 ms 124356 KB Output is correct
24 Correct 192 ms 22356 KB Output is correct
25 Correct 305 ms 28680 KB Output is correct
26 Correct 242 ms 28524 KB Output is correct
27 Correct 670 ms 131900 KB Output is correct
28 Correct 694 ms 131920 KB Output is correct
29 Correct 731 ms 131976 KB Output is correct
30 Correct 715 ms 132104 KB Output is correct
31 Correct 1 ms 348 KB Output is correct
32 Correct 33 ms 9436 KB Output is correct
33 Correct 74 ms 11868 KB Output is correct
34 Correct 615 ms 131848 KB Output is correct
35 Correct 9 ms 2140 KB Output is correct
36 Correct 50 ms 8140 KB Output is correct
37 Correct 114 ms 15488 KB Output is correct
38 Correct 212 ms 47344 KB Output is correct
39 Correct 319 ms 64916 KB Output is correct
40 Correct 435 ms 82488 KB Output is correct
41 Correct 538 ms 100156 KB Output is correct
42 Correct 641 ms 117564 KB Output is correct
43 Correct 0 ms 344 KB Output is correct
44 Correct 1 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 0 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 1 ms 344 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 279 ms 67140 KB Output is correct
57 Correct 426 ms 97848 KB Output is correct
58 Correct 437 ms 97084 KB Output is correct
59 Correct 1 ms 344 KB Output is correct
60 Correct 0 ms 348 KB Output is correct
61 Correct 1 ms 348 KB Output is correct
62 Correct 638 ms 147620 KB Output is correct
63 Correct 615 ms 147764 KB Output is correct
64 Correct 620 ms 149660 KB Output is correct
65 Correct 3 ms 1116 KB Output is correct
66 Correct 5 ms 1588 KB Output is correct
67 Correct 279 ms 63460 KB Output is correct
68 Correct 461 ms 97848 KB Output is correct
69 Correct 673 ms 127036 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 436 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 0 ms 344 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 436 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 291 ms 76356 KB Output is correct
10 Correct 17 ms 8028 KB Output is correct
11 Correct 114 ms 41736 KB Output is correct
12 Correct 28 ms 11856 KB Output is correct
13 Correct 32 ms 11604 KB Output is correct
14 Correct 1 ms 600 KB Output is correct
15 Correct 1 ms 800 KB Output is correct
16 Correct 284 ms 71688 KB Output is correct
17 Correct 624 ms 154172 KB Output is correct
18 Correct 635 ms 145708 KB Output is correct
19 Correct 614 ms 135736 KB Output is correct
20 Correct 684 ms 122168 KB Output is correct
21 Correct 574 ms 117816 KB Output is correct
22 Correct 0 ms 348 KB Output is correct
23 Correct 75 ms 19440 KB Output is correct
24 Correct 20 ms 4052 KB Output is correct
25 Correct 74 ms 11372 KB Output is correct
26 Correct 138 ms 18884 KB Output is correct
27 Correct 308 ms 63300 KB Output is correct
28 Correct 386 ms 78380 KB Output is correct
29 Correct 495 ms 94940 KB Output is correct
30 Correct 625 ms 110396 KB Output is correct
31 Correct 665 ms 125244 KB Output is correct
32 Correct 665 ms 136252 KB Output is correct
33 Correct 628 ms 153912 KB Output is correct
34 Correct 4 ms 1372 KB Output is correct
35 Correct 7 ms 2140 KB Output is correct
36 Correct 284 ms 65352 KB Output is correct
37 Correct 467 ms 98620 KB Output is correct
38 Correct 657 ms 131896 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 436 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 0 ms 344 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 436 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 291 ms 76356 KB Output is correct
10 Correct 17 ms 8028 KB Output is correct
11 Correct 114 ms 41736 KB Output is correct
12 Correct 28 ms 11856 KB Output is correct
13 Correct 32 ms 11604 KB Output is correct
14 Correct 1 ms 600 KB Output is correct
15 Correct 1 ms 800 KB Output is correct
16 Correct 284 ms 71688 KB Output is correct
17 Correct 0 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 344 KB Output is correct
21 Correct 0 ms 348 KB Output is correct
22 Correct 0 ms 344 KB Output is correct
23 Correct 693 ms 132240 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 856 KB Output is correct
27 Correct 3 ms 860 KB Output is correct
28 Correct 224 ms 53596 KB Output is correct
29 Correct 321 ms 78664 KB Output is correct
30 Correct 502 ms 106660 KB Output is correct
31 Correct 643 ms 130620 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 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 1 ms 344 KB Output is correct
39 Correct 0 ms 348 KB Output is correct
40 Correct 0 ms 344 KB Output is correct
41 Correct 0 ms 344 KB Output is correct
42 Correct 0 ms 348 KB Output is correct
43 Correct 2 ms 604 KB Output is correct
44 Correct 2 ms 860 KB Output is correct
45 Correct 270 ms 66980 KB Output is correct
46 Correct 402 ms 97848 KB Output is correct
47 Correct 434 ms 97088 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 428 KB Output is correct
54 Correct 0 ms 348 KB Output is correct
55 Correct 694 ms 126276 KB Output is correct
56 Correct 1 ms 348 KB Output is correct
57 Correct 4 ms 1372 KB Output is correct
58 Correct 13 ms 4224 KB Output is correct
59 Correct 8 ms 1884 KB Output is correct
60 Correct 285 ms 65060 KB Output is correct
61 Correct 441 ms 87100 KB Output is correct
62 Correct 560 ms 105020 KB Output is correct
63 Correct 709 ms 126276 KB Output is correct
64 Correct 0 ms 344 KB Output is correct
65 Correct 1 ms 344 KB Output is correct
66 Correct 0 ms 348 KB Output is correct
67 Correct 607 ms 147516 KB Output is correct
68 Correct 625 ms 147944 KB Output is correct
69 Correct 611 ms 149816 KB Output is correct
70 Correct 3 ms 1116 KB Output is correct
71 Correct 6 ms 1628 KB Output is correct
72 Correct 280 ms 63464 KB Output is correct
73 Correct 468 ms 97852 KB Output is correct
74 Correct 706 ms 127036 KB Output is correct
75 Correct 641 ms 136248 KB Output is correct
76 Correct 656 ms 153912 KB Output is correct
77 Correct 4 ms 1372 KB Output is correct
78 Correct 7 ms 2140 KB Output is correct
79 Correct 289 ms 65192 KB Output is correct
80 Correct 487 ms 98616 KB Output is correct
81 Correct 772 ms 131900 KB Output is correct
82 Correct 0 ms 348 KB Output is correct
83 Correct 1 ms 348 KB Output is correct
84 Correct 1 ms 348 KB Output is correct
85 Correct 651 ms 135600 KB Output is correct
86 Correct 776 ms 131132 KB Output is correct
87 Correct 761 ms 128684 KB Output is correct
88 Correct 641 ms 124356 KB Output is correct
89 Correct 192 ms 22356 KB Output is correct
90 Correct 305 ms 28680 KB Output is correct
91 Correct 242 ms 28524 KB Output is correct
92 Correct 670 ms 131900 KB Output is correct
93 Correct 694 ms 131920 KB Output is correct
94 Correct 731 ms 131976 KB Output is correct
95 Correct 715 ms 132104 KB Output is correct
96 Correct 1 ms 348 KB Output is correct
97 Correct 33 ms 9436 KB Output is correct
98 Correct 74 ms 11868 KB Output is correct
99 Correct 615 ms 131848 KB Output is correct
100 Correct 9 ms 2140 KB Output is correct
101 Correct 50 ms 8140 KB Output is correct
102 Correct 114 ms 15488 KB Output is correct
103 Correct 212 ms 47344 KB Output is correct
104 Correct 319 ms 64916 KB Output is correct
105 Correct 435 ms 82488 KB Output is correct
106 Correct 538 ms 100156 KB Output is correct
107 Correct 641 ms 117564 KB Output is correct
108 Correct 0 ms 344 KB Output is correct
109 Correct 1 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 0 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 1 ms 344 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 279 ms 67140 KB Output is correct
122 Correct 426 ms 97848 KB Output is correct
123 Correct 437 ms 97084 KB Output is correct
124 Correct 1 ms 344 KB Output is correct
125 Correct 0 ms 348 KB Output is correct
126 Correct 1 ms 348 KB Output is correct
127 Correct 638 ms 147620 KB Output is correct
128 Correct 615 ms 147764 KB Output is correct
129 Correct 620 ms 149660 KB Output is correct
130 Correct 3 ms 1116 KB Output is correct
131 Correct 5 ms 1588 KB Output is correct
132 Correct 279 ms 63460 KB Output is correct
133 Correct 461 ms 97848 KB Output is correct
134 Correct 673 ms 127036 KB Output is correct
135 Correct 624 ms 154172 KB Output is correct
136 Correct 635 ms 145708 KB Output is correct
137 Correct 614 ms 135736 KB Output is correct
138 Correct 684 ms 122168 KB Output is correct
139 Correct 574 ms 117816 KB Output is correct
140 Correct 0 ms 348 KB Output is correct
141 Correct 75 ms 19440 KB Output is correct
142 Correct 20 ms 4052 KB Output is correct
143 Correct 74 ms 11372 KB Output is correct
144 Correct 138 ms 18884 KB Output is correct
145 Correct 308 ms 63300 KB Output is correct
146 Correct 386 ms 78380 KB Output is correct
147 Correct 495 ms 94940 KB Output is correct
148 Correct 625 ms 110396 KB Output is correct
149 Correct 665 ms 125244 KB Output is correct
150 Correct 665 ms 136252 KB Output is correct
151 Correct 628 ms 153912 KB Output is correct
152 Correct 4 ms 1372 KB Output is correct
153 Correct 7 ms 2140 KB Output is correct
154 Correct 284 ms 65352 KB Output is correct
155 Correct 467 ms 98620 KB Output is correct
156 Correct 657 ms 131896 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 757 ms 121236 KB Tree @(1791, 1573) appears more than once: for edges on positions 368 and 372
162 Halted 0 ms 0 KB -