Submission #440569

# Submission time Handle Problem Language Result Execution time Memory
440569 2021-07-02T13:12:27 Z MetalPower Fountain Parks (IOI21_parks) C++17
100 / 100
776 ms 81016 KB
#include <bits/stdc++.h>
using namespace std;

#include "parks.h"

#define pii pair<int, int>
#define fi first
#define se second
#define mp make_pair

const int MX = 2e5 + 10;

int dx[4] = {2, -2, 0, 0}, dy[4] = {0, 0, 2, -2};
int dgx[4] = {1, 1, -1, -1}, dgy[4] = {1, -1, 1, -1};

pii pos[MX]; map<pii, int> nd;
bool vis[MX];

void dfs(int u){
	vis[u] = true;
	int nx = pos[u].fi, ny = pos[u].se;

	for(int i = 0; i < 4; i++){
		int v = nd[mp(nx + dx[i], ny + dy[i])];
		if(v != 0 && !vis[v]) dfs(v);
	}
}

// if there doesn't exist 2 * 2 squares 
// we can color the 2 * 2 cells by black or white like a chess board
// if it is black color the left or right
// if it is white color the up or down
// We know that for every color at most direction exists because there doesn't exist 2 * 2 squares

/*
void build(vector<int> u, vector<int> v, vector<int> a, vector<int> b){
	int N = u.size();
	for(int i = 0; i < N; i++){
		printf("edge %d - %d and bench at (%d, %d)\n", u[i], v[i], a[i], b[i]);
	}
}
*/

vector<pii> pts;

int construct_roads(vector<int> x, vector<int> y){

	int N = x.size();
	vector<int> u, v, a, b; // u - v the fountains, (a, b) the index of the bench

	for(int i = 0; i < N; i++){
		pos[i + 1] = mp(x[i], y[i]);
		nd[pos[i + 1]] = i + 1;

		for(int j = 0; j < 4; j++)
			pts.push_back(mp(x[i] + dgx[j], y[i] + dgy[j]));
	}

	dfs(1);

	for(int i = 0; i < N; i++) if(!vis[i + 1]) return 0;

	sort(pts.begin(), pts.end());
	pts.resize(unique(pts.begin(), pts.end()) - pts.begin());

	for(auto p : pts){
		bool st = ((p.fi >> 1) + (p.se >> 1)) & 1;

		if(st){
			// left or right
			if(nd[mp(p.fi - 1, p.se - 1)] && nd[mp(p.fi - 1, p.se + 1)]){
				u.push_back(nd[mp(p.fi - 1, p.se - 1)]);
				v.push_back(nd[mp(p.fi - 1, p.se + 1)]);
				a.push_back(p.fi);
				b.push_back(p.se);
			}else if(nd[mp(p.fi + 1, p.se - 1)] && nd[mp(p.fi + 1, p.se + 1)]){
				u.push_back(nd[mp(p.fi + 1, p.se - 1)]);
				v.push_back(nd[mp(p.fi + 1, p.se + 1)]);
				a.push_back(p.fi);
				b.push_back(p.se);
			}
		}else{
			// up or down
			if(nd[mp(p.fi - 1, p.se + 1)] && nd[mp(p.fi + 1, p.se + 1)]){
				u.push_back(nd[mp(p.fi - 1, p.se + 1)]);
				v.push_back(nd[mp(p.fi + 1, p.se + 1)]);
				a.push_back(p.fi);
				b.push_back(p.se);
			}else if(nd[mp(p.fi - 1, p.se - 1)] && nd[mp(p.fi + 1, p.se - 1)]){
				u.push_back(nd[mp(p.fi - 1, p.se - 1)]);
				v.push_back(nd[mp(p.fi + 1, p.se - 1)]);
				a.push_back(p.fi);
				b.push_back(p.se);
			}
		}
	}

	for(auto& p : u) p--;
	for(auto& p : v) p--;

	build(u, v, a, b);
	return 1;
}

/*
int main(){
	int N;
	vector<int> x, y;

	scanf("%d", &N);
	x.resize(N); y.resize(N);

	for(int i = 0; i < N; i++) scanf("%d %d", &x[i], &y[i]);

	printf("%d\n", construct_roads(x, y));
}
*/
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
6 Correct 0 ms 204 KB Output is correct
7 Correct 0 ms 204 KB Output is correct
8 Correct 0 ms 204 KB Output is correct
9 Correct 362 ms 39536 KB Output is correct
10 Correct 25 ms 4396 KB Output is correct
11 Correct 155 ms 21780 KB Output is correct
12 Correct 40 ms 6296 KB Output is correct
13 Correct 48 ms 12140 KB Output is correct
14 Correct 1 ms 460 KB Output is correct
15 Correct 2 ms 588 KB Output is correct
16 Correct 367 ms 35696 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
6 Correct 0 ms 204 KB Output is correct
7 Correct 0 ms 204 KB Output is correct
8 Correct 0 ms 204 KB Output is correct
9 Correct 362 ms 39536 KB Output is correct
10 Correct 25 ms 4396 KB Output is correct
11 Correct 155 ms 21780 KB Output is correct
12 Correct 40 ms 6296 KB Output is correct
13 Correct 48 ms 12140 KB Output is correct
14 Correct 1 ms 460 KB Output is correct
15 Correct 2 ms 588 KB Output is correct
16 Correct 367 ms 35696 KB Output is correct
17 Correct 0 ms 204 KB Output is correct
18 Correct 1 ms 204 KB Output is correct
19 Correct 1 ms 204 KB Output is correct
20 Correct 1 ms 204 KB Output is correct
21 Correct 1 ms 204 KB Output is correct
22 Correct 0 ms 204 KB Output is correct
23 Correct 722 ms 66028 KB Output is correct
24 Correct 0 ms 204 KB Output is correct
25 Correct 3 ms 588 KB Output is correct
26 Correct 3 ms 844 KB Output is correct
27 Correct 3 ms 844 KB Output is correct
28 Correct 230 ms 27356 KB Output is correct
29 Correct 362 ms 38012 KB Output is correct
30 Correct 544 ms 54028 KB Output is correct
31 Correct 658 ms 64252 KB Output is correct
32 Correct 0 ms 204 KB Output is correct
33 Correct 0 ms 204 KB Output is correct
34 Correct 0 ms 204 KB Output is correct
35 Correct 0 ms 204 KB Output is correct
36 Correct 0 ms 204 KB Output is correct
37 Correct 0 ms 204 KB Output is correct
38 Correct 1 ms 204 KB Output is correct
39 Correct 0 ms 204 KB Output is correct
40 Correct 0 ms 204 KB Output is correct
41 Correct 0 ms 204 KB Output is correct
42 Correct 0 ms 204 KB Output is correct
43 Correct 2 ms 588 KB Output is correct
44 Correct 2 ms 716 KB Output is correct
45 Correct 329 ms 34600 KB Output is correct
46 Correct 505 ms 50960 KB Output is correct
47 Correct 518 ms 50336 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
6 Correct 0 ms 204 KB Output is correct
7 Correct 0 ms 204 KB Output is correct
8 Correct 0 ms 204 KB Output is correct
9 Correct 362 ms 39536 KB Output is correct
10 Correct 25 ms 4396 KB Output is correct
11 Correct 155 ms 21780 KB Output is correct
12 Correct 40 ms 6296 KB Output is correct
13 Correct 48 ms 12140 KB Output is correct
14 Correct 1 ms 460 KB Output is correct
15 Correct 2 ms 588 KB Output is correct
16 Correct 367 ms 35696 KB Output is correct
17 Correct 0 ms 204 KB Output is correct
18 Correct 1 ms 204 KB Output is correct
19 Correct 1 ms 204 KB Output is correct
20 Correct 1 ms 204 KB Output is correct
21 Correct 1 ms 204 KB Output is correct
22 Correct 0 ms 204 KB Output is correct
23 Correct 722 ms 66028 KB Output is correct
24 Correct 0 ms 204 KB Output is correct
25 Correct 3 ms 588 KB Output is correct
26 Correct 3 ms 844 KB Output is correct
27 Correct 3 ms 844 KB Output is correct
28 Correct 230 ms 27356 KB Output is correct
29 Correct 362 ms 38012 KB Output is correct
30 Correct 544 ms 54028 KB Output is correct
31 Correct 658 ms 64252 KB Output is correct
32 Correct 0 ms 204 KB Output is correct
33 Correct 0 ms 204 KB Output is correct
34 Correct 0 ms 204 KB Output is correct
35 Correct 0 ms 204 KB Output is correct
36 Correct 0 ms 204 KB Output is correct
37 Correct 0 ms 204 KB Output is correct
38 Correct 1 ms 204 KB Output is correct
39 Correct 0 ms 204 KB Output is correct
40 Correct 0 ms 204 KB Output is correct
41 Correct 0 ms 204 KB Output is correct
42 Correct 0 ms 204 KB Output is correct
43 Correct 2 ms 588 KB Output is correct
44 Correct 2 ms 716 KB Output is correct
45 Correct 329 ms 34600 KB Output is correct
46 Correct 505 ms 50960 KB Output is correct
47 Correct 518 ms 50336 KB Output is correct
48 Correct 0 ms 204 KB Output is correct
49 Correct 0 ms 204 KB Output is correct
50 Correct 1 ms 204 KB Output is correct
51 Correct 0 ms 204 KB Output is correct
52 Correct 0 ms 204 KB Output is correct
53 Correct 0 ms 204 KB Output is correct
54 Correct 1 ms 204 KB Output is correct
55 Correct 626 ms 58512 KB Output is correct
56 Correct 0 ms 204 KB Output is correct
57 Correct 4 ms 844 KB Output is correct
58 Correct 13 ms 2172 KB Output is correct
59 Correct 6 ms 1736 KB Output is correct
60 Correct 280 ms 31248 KB Output is correct
61 Correct 430 ms 42796 KB Output is correct
62 Correct 517 ms 49504 KB Output is correct
63 Correct 679 ms 57820 KB Output is correct
64 Correct 1 ms 204 KB Output is correct
65 Correct 0 ms 204 KB Output is correct
66 Correct 0 ms 204 KB Output is correct
67 Correct 745 ms 68912 KB Output is correct
68 Correct 757 ms 69192 KB Output is correct
69 Correct 737 ms 71004 KB Output is correct
70 Correct 3 ms 976 KB Output is correct
71 Correct 6 ms 1480 KB Output is correct
72 Correct 326 ms 30116 KB Output is correct
73 Correct 557 ms 47724 KB Output is correct
74 Correct 717 ms 60528 KB Output is correct
75 Correct 713 ms 66144 KB Output is correct
76 Correct 772 ms 74348 KB Output is correct
77 Correct 4 ms 1224 KB Output is correct
78 Correct 7 ms 1732 KB Output is correct
79 Correct 322 ms 31680 KB Output is correct
80 Correct 520 ms 48420 KB Output is correct
81 Correct 719 ms 64620 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
6 Correct 0 ms 204 KB Output is correct
7 Correct 0 ms 204 KB Output is correct
8 Correct 0 ms 204 KB Output is correct
9 Correct 362 ms 39536 KB Output is correct
10 Correct 25 ms 4396 KB Output is correct
11 Correct 155 ms 21780 KB Output is correct
12 Correct 40 ms 6296 KB Output is correct
13 Correct 48 ms 12140 KB Output is correct
14 Correct 1 ms 460 KB Output is correct
15 Correct 2 ms 588 KB Output is correct
16 Correct 367 ms 35696 KB Output is correct
17 Correct 0 ms 204 KB Output is correct
18 Correct 0 ms 204 KB Output is correct
19 Correct 0 ms 204 KB Output is correct
20 Correct 652 ms 74280 KB Output is correct
21 Correct 725 ms 70440 KB Output is correct
22 Correct 697 ms 68512 KB Output is correct
23 Correct 613 ms 63572 KB Output is correct
24 Correct 177 ms 23840 KB Output is correct
25 Correct 180 ms 23988 KB Output is correct
26 Correct 181 ms 24096 KB Output is correct
27 Correct 630 ms 49404 KB Output is correct
28 Correct 643 ms 49592 KB Output is correct
29 Correct 714 ms 49404 KB Output is correct
30 Correct 726 ms 49476 KB Output is correct
31 Correct 1 ms 204 KB Output is correct
32 Correct 40 ms 4540 KB Output is correct
33 Correct 95 ms 11936 KB Output is correct
34 Correct 628 ms 65476 KB Output is correct
35 Correct 8 ms 1732 KB Output is correct
36 Correct 38 ms 6712 KB Output is correct
37 Correct 80 ms 12588 KB Output is correct
38 Correct 234 ms 18972 KB Output is correct
39 Correct 330 ms 25672 KB Output is correct
40 Correct 451 ms 33284 KB Output is correct
41 Correct 553 ms 39720 KB Output is correct
42 Correct 648 ms 46960 KB Output is correct
43 Correct 0 ms 204 KB Output is correct
44 Correct 0 ms 204 KB Output is correct
45 Correct 0 ms 204 KB Output is correct
46 Correct 0 ms 204 KB Output is correct
47 Correct 1 ms 204 KB Output is correct
48 Correct 0 ms 204 KB Output is correct
49 Correct 0 ms 204 KB Output is correct
50 Correct 0 ms 204 KB Output is correct
51 Correct 0 ms 204 KB Output is correct
52 Correct 0 ms 204 KB Output is correct
53 Correct 1 ms 204 KB Output is correct
54 Correct 2 ms 588 KB Output is correct
55 Correct 2 ms 716 KB Output is correct
56 Correct 326 ms 34588 KB Output is correct
57 Correct 510 ms 50988 KB Output is correct
58 Correct 509 ms 50308 KB Output is correct
59 Correct 0 ms 204 KB Output is correct
60 Correct 0 ms 204 KB Output is correct
61 Correct 0 ms 204 KB Output is correct
62 Correct 759 ms 68888 KB Output is correct
63 Correct 769 ms 69276 KB Output is correct
64 Correct 742 ms 71020 KB Output is correct
65 Correct 3 ms 972 KB Output is correct
66 Correct 5 ms 1480 KB Output is correct
67 Correct 331 ms 30120 KB Output is correct
68 Correct 529 ms 47912 KB Output is correct
69 Correct 758 ms 60584 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
6 Correct 0 ms 204 KB Output is correct
7 Correct 0 ms 204 KB Output is correct
8 Correct 0 ms 204 KB Output is correct
9 Correct 362 ms 39536 KB Output is correct
10 Correct 25 ms 4396 KB Output is correct
11 Correct 155 ms 21780 KB Output is correct
12 Correct 40 ms 6296 KB Output is correct
13 Correct 48 ms 12140 KB Output is correct
14 Correct 1 ms 460 KB Output is correct
15 Correct 2 ms 588 KB Output is correct
16 Correct 367 ms 35696 KB Output is correct
17 Correct 776 ms 81016 KB Output is correct
18 Correct 735 ms 73636 KB Output is correct
19 Correct 718 ms 74492 KB Output is correct
20 Correct 703 ms 54432 KB Output is correct
21 Correct 641 ms 55396 KB Output is correct
22 Correct 0 ms 204 KB Output is correct
23 Correct 87 ms 9192 KB Output is correct
24 Correct 19 ms 3344 KB Output is correct
25 Correct 61 ms 10072 KB Output is correct
26 Correct 104 ms 15248 KB Output is correct
27 Correct 303 ms 27268 KB Output is correct
28 Correct 423 ms 35240 KB Output is correct
29 Correct 498 ms 41836 KB Output is correct
30 Correct 603 ms 47892 KB Output is correct
31 Correct 694 ms 54284 KB Output is correct
32 Correct 724 ms 66216 KB Output is correct
33 Correct 760 ms 74388 KB Output is correct
34 Correct 4 ms 1224 KB Output is correct
35 Correct 7 ms 1828 KB Output is correct
36 Correct 331 ms 31692 KB Output is correct
37 Correct 523 ms 48404 KB Output is correct
38 Correct 733 ms 64684 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
6 Correct 0 ms 204 KB Output is correct
7 Correct 0 ms 204 KB Output is correct
8 Correct 0 ms 204 KB Output is correct
9 Correct 362 ms 39536 KB Output is correct
10 Correct 25 ms 4396 KB Output is correct
11 Correct 155 ms 21780 KB Output is correct
12 Correct 40 ms 6296 KB Output is correct
13 Correct 48 ms 12140 KB Output is correct
14 Correct 1 ms 460 KB Output is correct
15 Correct 2 ms 588 KB Output is correct
16 Correct 367 ms 35696 KB Output is correct
17 Correct 0 ms 204 KB Output is correct
18 Correct 1 ms 204 KB Output is correct
19 Correct 1 ms 204 KB Output is correct
20 Correct 1 ms 204 KB Output is correct
21 Correct 1 ms 204 KB Output is correct
22 Correct 0 ms 204 KB Output is correct
23 Correct 722 ms 66028 KB Output is correct
24 Correct 0 ms 204 KB Output is correct
25 Correct 3 ms 588 KB Output is correct
26 Correct 3 ms 844 KB Output is correct
27 Correct 3 ms 844 KB Output is correct
28 Correct 230 ms 27356 KB Output is correct
29 Correct 362 ms 38012 KB Output is correct
30 Correct 544 ms 54028 KB Output is correct
31 Correct 658 ms 64252 KB Output is correct
32 Correct 0 ms 204 KB Output is correct
33 Correct 0 ms 204 KB Output is correct
34 Correct 0 ms 204 KB Output is correct
35 Correct 0 ms 204 KB Output is correct
36 Correct 0 ms 204 KB Output is correct
37 Correct 0 ms 204 KB Output is correct
38 Correct 1 ms 204 KB Output is correct
39 Correct 0 ms 204 KB Output is correct
40 Correct 0 ms 204 KB Output is correct
41 Correct 0 ms 204 KB Output is correct
42 Correct 0 ms 204 KB Output is correct
43 Correct 2 ms 588 KB Output is correct
44 Correct 2 ms 716 KB Output is correct
45 Correct 329 ms 34600 KB Output is correct
46 Correct 505 ms 50960 KB Output is correct
47 Correct 518 ms 50336 KB Output is correct
48 Correct 0 ms 204 KB Output is correct
49 Correct 0 ms 204 KB Output is correct
50 Correct 1 ms 204 KB Output is correct
51 Correct 0 ms 204 KB Output is correct
52 Correct 0 ms 204 KB Output is correct
53 Correct 0 ms 204 KB Output is correct
54 Correct 1 ms 204 KB Output is correct
55 Correct 626 ms 58512 KB Output is correct
56 Correct 0 ms 204 KB Output is correct
57 Correct 4 ms 844 KB Output is correct
58 Correct 13 ms 2172 KB Output is correct
59 Correct 6 ms 1736 KB Output is correct
60 Correct 280 ms 31248 KB Output is correct
61 Correct 430 ms 42796 KB Output is correct
62 Correct 517 ms 49504 KB Output is correct
63 Correct 679 ms 57820 KB Output is correct
64 Correct 1 ms 204 KB Output is correct
65 Correct 0 ms 204 KB Output is correct
66 Correct 0 ms 204 KB Output is correct
67 Correct 745 ms 68912 KB Output is correct
68 Correct 757 ms 69192 KB Output is correct
69 Correct 737 ms 71004 KB Output is correct
70 Correct 3 ms 976 KB Output is correct
71 Correct 6 ms 1480 KB Output is correct
72 Correct 326 ms 30116 KB Output is correct
73 Correct 557 ms 47724 KB Output is correct
74 Correct 717 ms 60528 KB Output is correct
75 Correct 713 ms 66144 KB Output is correct
76 Correct 772 ms 74348 KB Output is correct
77 Correct 4 ms 1224 KB Output is correct
78 Correct 7 ms 1732 KB Output is correct
79 Correct 322 ms 31680 KB Output is correct
80 Correct 520 ms 48420 KB Output is correct
81 Correct 719 ms 64620 KB Output is correct
82 Correct 0 ms 204 KB Output is correct
83 Correct 0 ms 204 KB Output is correct
84 Correct 0 ms 204 KB Output is correct
85 Correct 652 ms 74280 KB Output is correct
86 Correct 725 ms 70440 KB Output is correct
87 Correct 697 ms 68512 KB Output is correct
88 Correct 613 ms 63572 KB Output is correct
89 Correct 177 ms 23840 KB Output is correct
90 Correct 180 ms 23988 KB Output is correct
91 Correct 181 ms 24096 KB Output is correct
92 Correct 630 ms 49404 KB Output is correct
93 Correct 643 ms 49592 KB Output is correct
94 Correct 714 ms 49404 KB Output is correct
95 Correct 726 ms 49476 KB Output is correct
96 Correct 1 ms 204 KB Output is correct
97 Correct 40 ms 4540 KB Output is correct
98 Correct 95 ms 11936 KB Output is correct
99 Correct 628 ms 65476 KB Output is correct
100 Correct 8 ms 1732 KB Output is correct
101 Correct 38 ms 6712 KB Output is correct
102 Correct 80 ms 12588 KB Output is correct
103 Correct 234 ms 18972 KB Output is correct
104 Correct 330 ms 25672 KB Output is correct
105 Correct 451 ms 33284 KB Output is correct
106 Correct 553 ms 39720 KB Output is correct
107 Correct 648 ms 46960 KB Output is correct
108 Correct 0 ms 204 KB Output is correct
109 Correct 0 ms 204 KB Output is correct
110 Correct 0 ms 204 KB Output is correct
111 Correct 0 ms 204 KB Output is correct
112 Correct 1 ms 204 KB Output is correct
113 Correct 0 ms 204 KB Output is correct
114 Correct 0 ms 204 KB Output is correct
115 Correct 0 ms 204 KB Output is correct
116 Correct 0 ms 204 KB Output is correct
117 Correct 0 ms 204 KB Output is correct
118 Correct 1 ms 204 KB Output is correct
119 Correct 2 ms 588 KB Output is correct
120 Correct 2 ms 716 KB Output is correct
121 Correct 326 ms 34588 KB Output is correct
122 Correct 510 ms 50988 KB Output is correct
123 Correct 509 ms 50308 KB Output is correct
124 Correct 0 ms 204 KB Output is correct
125 Correct 0 ms 204 KB Output is correct
126 Correct 0 ms 204 KB Output is correct
127 Correct 759 ms 68888 KB Output is correct
128 Correct 769 ms 69276 KB Output is correct
129 Correct 742 ms 71020 KB Output is correct
130 Correct 3 ms 972 KB Output is correct
131 Correct 5 ms 1480 KB Output is correct
132 Correct 331 ms 30120 KB Output is correct
133 Correct 529 ms 47912 KB Output is correct
134 Correct 758 ms 60584 KB Output is correct
135 Correct 776 ms 81016 KB Output is correct
136 Correct 735 ms 73636 KB Output is correct
137 Correct 718 ms 74492 KB Output is correct
138 Correct 703 ms 54432 KB Output is correct
139 Correct 641 ms 55396 KB Output is correct
140 Correct 0 ms 204 KB Output is correct
141 Correct 87 ms 9192 KB Output is correct
142 Correct 19 ms 3344 KB Output is correct
143 Correct 61 ms 10072 KB Output is correct
144 Correct 104 ms 15248 KB Output is correct
145 Correct 303 ms 27268 KB Output is correct
146 Correct 423 ms 35240 KB Output is correct
147 Correct 498 ms 41836 KB Output is correct
148 Correct 603 ms 47892 KB Output is correct
149 Correct 694 ms 54284 KB Output is correct
150 Correct 724 ms 66216 KB Output is correct
151 Correct 760 ms 74388 KB Output is correct
152 Correct 4 ms 1224 KB Output is correct
153 Correct 7 ms 1828 KB Output is correct
154 Correct 331 ms 31692 KB Output is correct
155 Correct 523 ms 48404 KB Output is correct
156 Correct 733 ms 64684 KB Output is correct
157 Correct 0 ms 204 KB Output is correct
158 Correct 0 ms 204 KB Output is correct
159 Correct 0 ms 204 KB Output is correct
160 Correct 0 ms 204 KB Output is correct
161 Correct 633 ms 48752 KB Output is correct
162 Correct 703 ms 74776 KB Output is correct
163 Correct 629 ms 57392 KB Output is correct
164 Correct 618 ms 56752 KB Output is correct
165 Correct 619 ms 58216 KB Output is correct
166 Correct 649 ms 56912 KB Output is correct
167 Correct 124 ms 10704 KB Output is correct
168 Correct 29 ms 4380 KB Output is correct
169 Correct 69 ms 10268 KB Output is correct
170 Correct 145 ms 20008 KB Output is correct
171 Correct 208 ms 24176 KB Output is correct
172 Correct 317 ms 23580 KB Output is correct
173 Correct 376 ms 29328 KB Output is correct
174 Correct 479 ms 31988 KB Output is correct
175 Correct 524 ms 40132 KB Output is correct
176 Correct 595 ms 41060 KB Output is correct
177 Correct 667 ms 44360 KB Output is correct