Submission #439200

# Submission time Handle Problem Language Result Execution time Memory
439200 2021-06-29T11:32:08 Z FSYo Fountain Parks (IOI21_parks) C++17
70 / 100
803 ms 138480 KB
#include<bits/stdc++.h>
#include "parks.h"
#define cs const
#define pb push_back
using namespace std;
typedef vector<int> vi; 
typedef long long ll;
typedef pair<int, int> pi; 
cs int N = 4e5 + 5; 
int n, fa[N];
map<int, int> c[N], e[N];
vector<pi> E; 
int fnd(int x) {
	if(x == fa[x]) return x; 
	return fa[x] = fnd(fa[x]);
}
void mer(int a, int b) {
	if(a < 0) return;
	if(fnd(a) == fnd(b)) return;
	E.pb(pi(a, b));
	e[a][b] = e[b][a] = E.size() - 1; 
	fa[fnd(a)] = fnd(b);
}
vector<int> G[N];
int dfn[N], low[N], tim;
int s[N], top, in[N], blk[N], m;

void dfs(int x) {
	dfn[x] = low[x] = ++ tim; 
	s[++top] = x, in[x] = 1; 
	for(int v : G[x]) {
		if(!dfn[v]) dfs(v), low[x] = min(low[x], low[v]);
		else if(in[v] && dfn[v] < low[x]) low[x] = dfn[v];
	}
	if(low[x] == dfn[x]) {
		++ m; do {
			in[s[top]] = 0;
			blk[s[top]] = m; 
		} while(s[top--] != x);
	}
}

#ifdef FSYo
void build(vi u, vi v, vi a, vi b) {
	int m = u.size();
	cout << m << endl;
//	map<pi, int> tt; 
//	for(int i = 0; i < m; i++) {
//		cout <<i<<' '<< x[u[i]] << " " << y[u[i]] << ' ' << x[v[i]] << ' ' << y[v[i]] << ' ' << a[i] << ' ' << b[i] << '\n';
//		for(int v : G[i]) cout << v << ' ';cout <<endl;
//		assert(tt[pi(a[i], b[i])] == 0);
//		tt[pi(a[i], b[i])] = 1; 
//	}
}
#endif

int construct_roads(vi x, vi y) {
	n = x.size();
	for(int i = 0; i < n; i++)
		c[x[i]][y[i]] = i + 1; 
	for(int i = 0; i < n; i++) fa[i] = i; 
	for(int x = 2; x <= 2e5; x += 2) 
	for(auto p : c[x]) {
		int y = p.first, t = p.second; 
		mer(c[x - 2][y] - 1, t - 1);
		mer(c[x][y - 2] - 1, t - 1);
	}
	if(E.size() < n - 1) return 0; 
	for(int i = 0; i < n - 1; i++) {
		int u = E[i].first, v = E[i].second; 
		if(x[u] != x[v]) continue; 
		if(y[u] > y[v]) swap(u, v);
		int a = c[x[u] - 2][y[u]] - 1, z = -1; 
		if(~a) z = e[a][u];
		if(~z) {
			G[i].pb(z);
			G[z + n - 1].pb(i + n - 1);
		} 
		z = -1; 
		a = c[x[u] + 2][y[u]] - 1; 
		if(~a) z = e[a][u];
		if(~z) {
			G[i + n - 1].pb(z);
			G[z + n - 1].pb(i);
		}
		z = -1;
		a = c[x[v] - 2][y[v]] - 1;
		if(~a) z = e[a][v];
		if(~z) {
			G[i].pb(z + n - 1);
			G[z].pb(i + n - 1);
		}
		z = -1;
		a = c[x[v] + 2][y[v]] - 1;
		if(~a) z = e[a][v];
		if(~z) {
			G[i + n - 1].pb(z + n - 1);
			G[z].pb(i);
		}
		z = -1; 
		a = c[x[u] + 2][y[u]] - 1;
		int b = c[x[v] + 2][y[v]] - 1; 
		if(~a && ~b) z = e[a][b];
		if(~z) {
			G[i + n - 1].pb(z + n - 1);
			G[z].pb(i);
		}
	}
	for(int i = 0; i < n - 1; i++) {
		int u = E[i].first, v = E[i].second; 
		if(y[u] != y[v]) continue; 
		if(x[u] > x[v]) swap(u, v);
		int a = c[x[u]][y[u] + 2] - 1, z = -1; 
		int b = c[x[v]][y[v] + 2] - 1; 
		if(~a && ~b) z = e[a][b];
		if(~z) {
			G[i + n - 1].pb(z + n - 1);
			G[z].pb(i);
		}
	}
	for(int i = 0; i < (n - 1) * 2; i++)
		if(!dfn[i]) dfs(i);
	vi u(n - 1), v(n - 1), a(n - 1), b(n - 1);
	for(int i = 0, o; i < n - 1; i++) {
		u[i] = E[i].first, v[i] = E[i].second;
		o = blk[i + n - 1] < blk[i];
		if(x[u[i]] == x[v[i]]) {
			b[i] = min(y[u[i]], y[v[i]]) + 1;
			a[i] = x[u[i]] + (o ? 1 : -1);
		}
		else {
			a[i] = min(x[u[i]], x[v[i]]) + 1; 
			b[i] = y[u[i]] + (o ? 1 : -1);
		}
	}
	build(u, v, a, b);
	return 1; 
}
#ifdef FSYo
int main() {
	freopen("1.in", "r", stdin);
//	freopen("1.out", "w", stdout);
	int n; 
	cin >> n; 
	vi x(n), y(n);
	for(int i = 0; i < n; i++)
		scanf("%d%d", &x[i], &y[i]);
	if(construct_roads(x, y)) {
		puts("YES");
	}
	else puts("NO");
	
	return 0; 
}
#endif

Compilation message

parks.cpp: In function 'int construct_roads(vi, vi)':
parks.cpp:68:14: warning: comparison of integer expressions of different signedness: 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   68 |  if(E.size() < n - 1) return 0;
      |     ~~~~~~~~~^~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 38 ms 47208 KB Output is correct
2 Correct 35 ms 47272 KB Output is correct
3 Correct 39 ms 47240 KB Output is correct
4 Correct 36 ms 47244 KB Output is correct
5 Correct 36 ms 47244 KB Output is correct
6 Correct 33 ms 47180 KB Output is correct
7 Correct 35 ms 47272 KB Output is correct
8 Correct 33 ms 47172 KB Output is correct
9 Correct 319 ms 82592 KB Output is correct
10 Correct 53 ms 50804 KB Output is correct
11 Correct 142 ms 66232 KB Output is correct
12 Correct 63 ms 52600 KB Output is correct
13 Correct 98 ms 56736 KB Output is correct
14 Correct 37 ms 47436 KB Output is correct
15 Correct 36 ms 47628 KB Output is correct
16 Correct 300 ms 82468 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 38 ms 47208 KB Output is correct
2 Correct 35 ms 47272 KB Output is correct
3 Correct 39 ms 47240 KB Output is correct
4 Correct 36 ms 47244 KB Output is correct
5 Correct 36 ms 47244 KB Output is correct
6 Correct 33 ms 47180 KB Output is correct
7 Correct 35 ms 47272 KB Output is correct
8 Correct 33 ms 47172 KB Output is correct
9 Correct 319 ms 82592 KB Output is correct
10 Correct 53 ms 50804 KB Output is correct
11 Correct 142 ms 66232 KB Output is correct
12 Correct 63 ms 52600 KB Output is correct
13 Correct 98 ms 56736 KB Output is correct
14 Correct 37 ms 47436 KB Output is correct
15 Correct 36 ms 47628 KB Output is correct
16 Correct 300 ms 82468 KB Output is correct
17 Correct 27 ms 47164 KB Output is correct
18 Correct 28 ms 47260 KB Output is correct
19 Correct 28 ms 47180 KB Output is correct
20 Correct 27 ms 47248 KB Output is correct
21 Correct 34 ms 47256 KB Output is correct
22 Correct 34 ms 47308 KB Output is correct
23 Correct 797 ms 126896 KB Output is correct
24 Correct 34 ms 47308 KB Output is correct
25 Correct 36 ms 47632 KB Output is correct
26 Correct 40 ms 47740 KB Output is correct
27 Correct 42 ms 47948 KB Output is correct
28 Correct 299 ms 78912 KB Output is correct
29 Correct 418 ms 94792 KB Output is correct
30 Correct 600 ms 110776 KB Output is correct
31 Correct 788 ms 126608 KB Output is correct
32 Correct 33 ms 47232 KB Output is correct
33 Correct 37 ms 47232 KB Output is correct
34 Correct 34 ms 47252 KB Output is correct
35 Correct 39 ms 47232 KB Output is correct
36 Correct 36 ms 47180 KB Output is correct
37 Correct 35 ms 47272 KB Output is correct
38 Correct 37 ms 47216 KB Output is correct
39 Correct 35 ms 47184 KB Output is correct
40 Correct 38 ms 47272 KB Output is correct
41 Correct 33 ms 47180 KB Output is correct
42 Correct 34 ms 47164 KB Output is correct
43 Correct 38 ms 47680 KB Output is correct
44 Correct 39 ms 47844 KB Output is correct
45 Correct 333 ms 83056 KB Output is correct
46 Correct 494 ms 99264 KB Output is correct
47 Correct 489 ms 99296 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 38 ms 47208 KB Output is correct
2 Correct 35 ms 47272 KB Output is correct
3 Correct 39 ms 47240 KB Output is correct
4 Correct 36 ms 47244 KB Output is correct
5 Correct 36 ms 47244 KB Output is correct
6 Correct 33 ms 47180 KB Output is correct
7 Correct 35 ms 47272 KB Output is correct
8 Correct 33 ms 47172 KB Output is correct
9 Correct 319 ms 82592 KB Output is correct
10 Correct 53 ms 50804 KB Output is correct
11 Correct 142 ms 66232 KB Output is correct
12 Correct 63 ms 52600 KB Output is correct
13 Correct 98 ms 56736 KB Output is correct
14 Correct 37 ms 47436 KB Output is correct
15 Correct 36 ms 47628 KB Output is correct
16 Correct 300 ms 82468 KB Output is correct
17 Correct 27 ms 47164 KB Output is correct
18 Correct 28 ms 47260 KB Output is correct
19 Correct 28 ms 47180 KB Output is correct
20 Correct 27 ms 47248 KB Output is correct
21 Correct 34 ms 47256 KB Output is correct
22 Correct 34 ms 47308 KB Output is correct
23 Correct 797 ms 126896 KB Output is correct
24 Correct 34 ms 47308 KB Output is correct
25 Correct 36 ms 47632 KB Output is correct
26 Correct 40 ms 47740 KB Output is correct
27 Correct 42 ms 47948 KB Output is correct
28 Correct 299 ms 78912 KB Output is correct
29 Correct 418 ms 94792 KB Output is correct
30 Correct 600 ms 110776 KB Output is correct
31 Correct 788 ms 126608 KB Output is correct
32 Correct 33 ms 47232 KB Output is correct
33 Correct 37 ms 47232 KB Output is correct
34 Correct 34 ms 47252 KB Output is correct
35 Correct 39 ms 47232 KB Output is correct
36 Correct 36 ms 47180 KB Output is correct
37 Correct 35 ms 47272 KB Output is correct
38 Correct 37 ms 47216 KB Output is correct
39 Correct 35 ms 47184 KB Output is correct
40 Correct 38 ms 47272 KB Output is correct
41 Correct 33 ms 47180 KB Output is correct
42 Correct 34 ms 47164 KB Output is correct
43 Correct 38 ms 47680 KB Output is correct
44 Correct 39 ms 47844 KB Output is correct
45 Correct 333 ms 83056 KB Output is correct
46 Correct 494 ms 99264 KB Output is correct
47 Correct 489 ms 99296 KB Output is correct
48 Correct 35 ms 47264 KB Output is correct
49 Correct 36 ms 47212 KB Output is correct
50 Correct 35 ms 47248 KB Output is correct
51 Correct 35 ms 47308 KB Output is correct
52 Correct 36 ms 47308 KB Output is correct
53 Correct 36 ms 47300 KB Output is correct
54 Correct 33 ms 47200 KB Output is correct
55 Correct 736 ms 121680 KB Output is correct
56 Correct 41 ms 47172 KB Output is correct
57 Correct 36 ms 47952 KB Output is correct
58 Correct 48 ms 49416 KB Output is correct
59 Correct 43 ms 49100 KB Output is correct
60 Correct 385 ms 84364 KB Output is correct
61 Correct 447 ms 97280 KB Output is correct
62 Correct 594 ms 108676 KB Output is correct
63 Correct 803 ms 121804 KB Output is correct
64 Correct 35 ms 47172 KB Output is correct
65 Correct 36 ms 47184 KB Output is correct
66 Correct 31 ms 47200 KB Output is correct
67 Correct 621 ms 113308 KB Output is correct
68 Correct 677 ms 114820 KB Output is correct
69 Correct 641 ms 113716 KB Output is correct
70 Correct 38 ms 48076 KB Output is correct
71 Correct 41 ms 48816 KB Output is correct
72 Correct 377 ms 82496 KB Output is correct
73 Correct 534 ms 100372 KB Output is correct
74 Correct 780 ms 118164 KB Output is correct
75 Correct 719 ms 117096 KB Output is correct
76 Correct 707 ms 114584 KB Output is correct
77 Correct 40 ms 48204 KB Output is correct
78 Correct 45 ms 49036 KB Output is correct
79 Correct 335 ms 81944 KB Output is correct
80 Correct 548 ms 99668 KB Output is correct
81 Correct 751 ms 117072 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 38 ms 47208 KB Output is correct
2 Correct 35 ms 47272 KB Output is correct
3 Correct 39 ms 47240 KB Output is correct
4 Correct 36 ms 47244 KB Output is correct
5 Correct 36 ms 47244 KB Output is correct
6 Correct 33 ms 47180 KB Output is correct
7 Correct 35 ms 47272 KB Output is correct
8 Correct 33 ms 47172 KB Output is correct
9 Correct 319 ms 82592 KB Output is correct
10 Correct 53 ms 50804 KB Output is correct
11 Correct 142 ms 66232 KB Output is correct
12 Correct 63 ms 52600 KB Output is correct
13 Correct 98 ms 56736 KB Output is correct
14 Correct 37 ms 47436 KB Output is correct
15 Correct 36 ms 47628 KB Output is correct
16 Correct 300 ms 82468 KB Output is correct
17 Correct 36 ms 47200 KB Output is correct
18 Correct 35 ms 47280 KB Output is correct
19 Correct 39 ms 47244 KB Output is correct
20 Correct 546 ms 138480 KB Output is correct
21 Correct 600 ms 130112 KB Output is correct
22 Correct 613 ms 130008 KB Output is correct
23 Correct 489 ms 107952 KB Output is correct
24 Correct 267 ms 79340 KB Output is correct
25 Correct 421 ms 90292 KB Output is correct
26 Correct 368 ms 90352 KB Output is correct
27 Correct 507 ms 108696 KB Output is correct
28 Correct 500 ms 108812 KB Output is correct
29 Correct 532 ms 108688 KB Output is correct
30 Correct 531 ms 108836 KB Output is correct
31 Correct 34 ms 47232 KB Output is correct
32 Correct 78 ms 52448 KB Output is correct
33 Correct 112 ms 63280 KB Output is correct
34 Correct 547 ms 138444 KB Output is correct
35 Correct 48 ms 49220 KB Output is correct
36 Correct 107 ms 57152 KB Output is correct
37 Correct 193 ms 67128 KB Output is correct
38 Correct 259 ms 75020 KB Output is correct
39 Correct 367 ms 85336 KB Output is correct
40 Correct 471 ms 95792 KB Output is correct
41 Correct 587 ms 106180 KB Output is correct
42 Correct 691 ms 116636 KB Output is correct
43 Correct 32 ms 47180 KB Output is correct
44 Correct 37 ms 47232 KB Output is correct
45 Correct 35 ms 47308 KB Output is correct
46 Correct 38 ms 47200 KB Output is correct
47 Correct 35 ms 47180 KB Output is correct
48 Correct 36 ms 47240 KB Output is correct
49 Correct 36 ms 47236 KB Output is correct
50 Correct 36 ms 47260 KB Output is correct
51 Correct 37 ms 47308 KB Output is correct
52 Correct 36 ms 47236 KB Output is correct
53 Correct 34 ms 47292 KB Output is correct
54 Correct 39 ms 47564 KB Output is correct
55 Correct 39 ms 47852 KB Output is correct
56 Correct 316 ms 83032 KB Output is correct
57 Correct 522 ms 99300 KB Output is correct
58 Correct 484 ms 99396 KB Output is correct
59 Correct 32 ms 47172 KB Output is correct
60 Correct 33 ms 47220 KB Output is correct
61 Correct 32 ms 47180 KB Output is correct
62 Correct 671 ms 113328 KB Output is correct
63 Correct 642 ms 114704 KB Output is correct
64 Correct 662 ms 113664 KB Output is correct
65 Correct 42 ms 48040 KB Output is correct
66 Correct 43 ms 48860 KB Output is correct
67 Correct 341 ms 82448 KB Output is correct
68 Correct 571 ms 100312 KB Output is correct
69 Correct 770 ms 118136 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 38 ms 47208 KB Output is correct
2 Correct 35 ms 47272 KB Output is correct
3 Correct 39 ms 47240 KB Output is correct
4 Correct 36 ms 47244 KB Output is correct
5 Correct 36 ms 47244 KB Output is correct
6 Correct 33 ms 47180 KB Output is correct
7 Correct 35 ms 47272 KB Output is correct
8 Correct 33 ms 47172 KB Output is correct
9 Correct 319 ms 82592 KB Output is correct
10 Correct 53 ms 50804 KB Output is correct
11 Correct 142 ms 66232 KB Output is correct
12 Correct 63 ms 52600 KB Output is correct
13 Correct 98 ms 56736 KB Output is correct
14 Correct 37 ms 47436 KB Output is correct
15 Correct 36 ms 47628 KB Output is correct
16 Correct 300 ms 82468 KB Output is correct
17 Correct 572 ms 119160 KB Output is correct
18 Correct 544 ms 118840 KB Output is correct
19 Correct 614 ms 130056 KB Output is correct
20 Correct 561 ms 109484 KB Output is correct
21 Correct 498 ms 106308 KB Output is correct
22 Correct 32 ms 47180 KB Output is correct
23 Correct 103 ms 58172 KB Output is correct
24 Correct 63 ms 51008 KB Output is correct
25 Correct 149 ms 60592 KB Output is correct
26 Correct 232 ms 70104 KB Output is correct
27 Correct 347 ms 80296 KB Output is correct
28 Correct 395 ms 88800 KB Output is correct
29 Correct 476 ms 97304 KB Output is correct
30 Correct 590 ms 105172 KB Output is correct
31 Correct 628 ms 113680 KB Output is correct
32 Correct 713 ms 117140 KB Output is correct
33 Correct 649 ms 114792 KB Output is correct
34 Correct 39 ms 48204 KB Output is correct
35 Correct 44 ms 48984 KB Output is correct
36 Correct 343 ms 81964 KB Output is correct
37 Correct 543 ms 99660 KB Output is correct
38 Correct 716 ms 117156 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 38 ms 47208 KB Output is correct
2 Correct 35 ms 47272 KB Output is correct
3 Correct 39 ms 47240 KB Output is correct
4 Correct 36 ms 47244 KB Output is correct
5 Correct 36 ms 47244 KB Output is correct
6 Correct 33 ms 47180 KB Output is correct
7 Correct 35 ms 47272 KB Output is correct
8 Correct 33 ms 47172 KB Output is correct
9 Correct 319 ms 82592 KB Output is correct
10 Correct 53 ms 50804 KB Output is correct
11 Correct 142 ms 66232 KB Output is correct
12 Correct 63 ms 52600 KB Output is correct
13 Correct 98 ms 56736 KB Output is correct
14 Correct 37 ms 47436 KB Output is correct
15 Correct 36 ms 47628 KB Output is correct
16 Correct 300 ms 82468 KB Output is correct
17 Correct 27 ms 47164 KB Output is correct
18 Correct 28 ms 47260 KB Output is correct
19 Correct 28 ms 47180 KB Output is correct
20 Correct 27 ms 47248 KB Output is correct
21 Correct 34 ms 47256 KB Output is correct
22 Correct 34 ms 47308 KB Output is correct
23 Correct 797 ms 126896 KB Output is correct
24 Correct 34 ms 47308 KB Output is correct
25 Correct 36 ms 47632 KB Output is correct
26 Correct 40 ms 47740 KB Output is correct
27 Correct 42 ms 47948 KB Output is correct
28 Correct 299 ms 78912 KB Output is correct
29 Correct 418 ms 94792 KB Output is correct
30 Correct 600 ms 110776 KB Output is correct
31 Correct 788 ms 126608 KB Output is correct
32 Correct 33 ms 47232 KB Output is correct
33 Correct 37 ms 47232 KB Output is correct
34 Correct 34 ms 47252 KB Output is correct
35 Correct 39 ms 47232 KB Output is correct
36 Correct 36 ms 47180 KB Output is correct
37 Correct 35 ms 47272 KB Output is correct
38 Correct 37 ms 47216 KB Output is correct
39 Correct 35 ms 47184 KB Output is correct
40 Correct 38 ms 47272 KB Output is correct
41 Correct 33 ms 47180 KB Output is correct
42 Correct 34 ms 47164 KB Output is correct
43 Correct 38 ms 47680 KB Output is correct
44 Correct 39 ms 47844 KB Output is correct
45 Correct 333 ms 83056 KB Output is correct
46 Correct 494 ms 99264 KB Output is correct
47 Correct 489 ms 99296 KB Output is correct
48 Correct 35 ms 47264 KB Output is correct
49 Correct 36 ms 47212 KB Output is correct
50 Correct 35 ms 47248 KB Output is correct
51 Correct 35 ms 47308 KB Output is correct
52 Correct 36 ms 47308 KB Output is correct
53 Correct 36 ms 47300 KB Output is correct
54 Correct 33 ms 47200 KB Output is correct
55 Correct 736 ms 121680 KB Output is correct
56 Correct 41 ms 47172 KB Output is correct
57 Correct 36 ms 47952 KB Output is correct
58 Correct 48 ms 49416 KB Output is correct
59 Correct 43 ms 49100 KB Output is correct
60 Correct 385 ms 84364 KB Output is correct
61 Correct 447 ms 97280 KB Output is correct
62 Correct 594 ms 108676 KB Output is correct
63 Correct 803 ms 121804 KB Output is correct
64 Correct 35 ms 47172 KB Output is correct
65 Correct 36 ms 47184 KB Output is correct
66 Correct 31 ms 47200 KB Output is correct
67 Correct 621 ms 113308 KB Output is correct
68 Correct 677 ms 114820 KB Output is correct
69 Correct 641 ms 113716 KB Output is correct
70 Correct 38 ms 48076 KB Output is correct
71 Correct 41 ms 48816 KB Output is correct
72 Correct 377 ms 82496 KB Output is correct
73 Correct 534 ms 100372 KB Output is correct
74 Correct 780 ms 118164 KB Output is correct
75 Correct 719 ms 117096 KB Output is correct
76 Correct 707 ms 114584 KB Output is correct
77 Correct 40 ms 48204 KB Output is correct
78 Correct 45 ms 49036 KB Output is correct
79 Correct 335 ms 81944 KB Output is correct
80 Correct 548 ms 99668 KB Output is correct
81 Correct 751 ms 117072 KB Output is correct
82 Correct 36 ms 47200 KB Output is correct
83 Correct 35 ms 47280 KB Output is correct
84 Correct 39 ms 47244 KB Output is correct
85 Correct 546 ms 138480 KB Output is correct
86 Correct 600 ms 130112 KB Output is correct
87 Correct 613 ms 130008 KB Output is correct
88 Correct 489 ms 107952 KB Output is correct
89 Correct 267 ms 79340 KB Output is correct
90 Correct 421 ms 90292 KB Output is correct
91 Correct 368 ms 90352 KB Output is correct
92 Correct 507 ms 108696 KB Output is correct
93 Correct 500 ms 108812 KB Output is correct
94 Correct 532 ms 108688 KB Output is correct
95 Correct 531 ms 108836 KB Output is correct
96 Correct 34 ms 47232 KB Output is correct
97 Correct 78 ms 52448 KB Output is correct
98 Correct 112 ms 63280 KB Output is correct
99 Correct 547 ms 138444 KB Output is correct
100 Correct 48 ms 49220 KB Output is correct
101 Correct 107 ms 57152 KB Output is correct
102 Correct 193 ms 67128 KB Output is correct
103 Correct 259 ms 75020 KB Output is correct
104 Correct 367 ms 85336 KB Output is correct
105 Correct 471 ms 95792 KB Output is correct
106 Correct 587 ms 106180 KB Output is correct
107 Correct 691 ms 116636 KB Output is correct
108 Correct 32 ms 47180 KB Output is correct
109 Correct 37 ms 47232 KB Output is correct
110 Correct 35 ms 47308 KB Output is correct
111 Correct 38 ms 47200 KB Output is correct
112 Correct 35 ms 47180 KB Output is correct
113 Correct 36 ms 47240 KB Output is correct
114 Correct 36 ms 47236 KB Output is correct
115 Correct 36 ms 47260 KB Output is correct
116 Correct 37 ms 47308 KB Output is correct
117 Correct 36 ms 47236 KB Output is correct
118 Correct 34 ms 47292 KB Output is correct
119 Correct 39 ms 47564 KB Output is correct
120 Correct 39 ms 47852 KB Output is correct
121 Correct 316 ms 83032 KB Output is correct
122 Correct 522 ms 99300 KB Output is correct
123 Correct 484 ms 99396 KB Output is correct
124 Correct 32 ms 47172 KB Output is correct
125 Correct 33 ms 47220 KB Output is correct
126 Correct 32 ms 47180 KB Output is correct
127 Correct 671 ms 113328 KB Output is correct
128 Correct 642 ms 114704 KB Output is correct
129 Correct 662 ms 113664 KB Output is correct
130 Correct 42 ms 48040 KB Output is correct
131 Correct 43 ms 48860 KB Output is correct
132 Correct 341 ms 82448 KB Output is correct
133 Correct 571 ms 100312 KB Output is correct
134 Correct 770 ms 118136 KB Output is correct
135 Correct 572 ms 119160 KB Output is correct
136 Correct 544 ms 118840 KB Output is correct
137 Correct 614 ms 130056 KB Output is correct
138 Correct 561 ms 109484 KB Output is correct
139 Correct 498 ms 106308 KB Output is correct
140 Correct 32 ms 47180 KB Output is correct
141 Correct 103 ms 58172 KB Output is correct
142 Correct 63 ms 51008 KB Output is correct
143 Correct 149 ms 60592 KB Output is correct
144 Correct 232 ms 70104 KB Output is correct
145 Correct 347 ms 80296 KB Output is correct
146 Correct 395 ms 88800 KB Output is correct
147 Correct 476 ms 97304 KB Output is correct
148 Correct 590 ms 105172 KB Output is correct
149 Correct 628 ms 113680 KB Output is correct
150 Correct 713 ms 117140 KB Output is correct
151 Correct 649 ms 114792 KB Output is correct
152 Correct 39 ms 48204 KB Output is correct
153 Correct 44 ms 48984 KB Output is correct
154 Correct 343 ms 81964 KB Output is correct
155 Correct 543 ms 99660 KB Output is correct
156 Correct 716 ms 117156 KB Output is correct
157 Correct 32 ms 47272 KB Output is correct
158 Correct 33 ms 47180 KB Output is correct
159 Correct 35 ms 47268 KB Output is correct
160 Correct 36 ms 47180 KB Output is correct
161 Correct 566 ms 112156 KB Output is correct
162 Correct 563 ms 138456 KB Output is correct
163 Correct 592 ms 131268 KB Output is correct
164 Correct 602 ms 131216 KB Output is correct
165 Correct 565 ms 118668 KB Output is correct
166 Correct 564 ms 113804 KB Output is correct
167 Incorrect 140 ms 62760 KB Tree @(185189, 21001) appears more than once: for edges on positions 3 and 4
168 Halted 0 ms 0 KB -