#include "parks.h"
#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using ii = pair<int, int>;
int DX[] = {-1, 0, 1, 0};
int DY[] = {0, 1, 0, -1};
const int MV = 1e9;
struct DSU {
int nrc;
vi e;
DSU(int n) : nrc(n), e(n, -1) {}
int repr(int u) {
while(e[u] >= 0) u = e[u];
return u;
}
void join(int u, int v) {
u = repr(u); v = repr(v);
if(u == v) return;
if(e[u] >= e[v]) swap(u, v);
e[u] += e[v];
e[v] = u;
--nrc;
}
};
int construct_roads(vi x, vi y) {
auto get_bench_coord = [&](int u, int v) -> pair<ii, ii> {
int xcm = (x[u] + x[v]) / 2, ycm = (y[u] + y[v]) / 2;
int dx = 2 - abs(x[u] - x[v]), dy = 2 - abs(y[u] - y[v]);
return make_pair(ii{xcm - dx / 2, ycm - dy / 2}, ii{xcm + dx / 2, ycm + dy / 2});
};
int n = x.size();
vector<ii> B;
map<ii, int> Id;
for(int i = 0; i < n; ++i)
Id[ii{x[i], y[i]}] = i;
for(int i = 0; i < n; ++i) {
for(int d = 0; d < 4; ++d) {
int nx = x[i] + 2 * DX[d], ny = y[i] + 2 * DY[d];
if(Id.count({nx, ny})) {
int u = Id[{nx, ny}];
auto [a, b] = get_bench_coord(u, i);
B.push_back(a);
B.push_back(b);
}
}
}
sort(B.begin(), B.end());
B.resize(unique(B.begin(), B.end()) - B.begin());
map<ii, int> IdB;
int m = B.size();
for(int i = 0; i < m; ++i) {
IdB[B[i]] = i;
}
vi U, V, RA, RB;
DSU Sol(n);
for(int i = 0; i < m; ++i) {
auto [x, y] = B[i];
int tip = ((((x + MV) / 2) & 1) + (((y + MV) / 2) & 1)) % 2;
if(tip) {
//leg la ceva vertical
int x1, y1, x2, y2;
x1 = x2 = x + 1;
y1 = y - 1; y2 = y + 1;
if(Id.count({x1, y1}) && Id.count({x2, y2})) {
int u = Id[{x1, y1}], v = Id[{x2, y2}];
U.push_back(u);
V.push_back(v);
RA.push_back(x);
RB.push_back(y);
Sol.join(u, v);
continue;
}
x1 = x2 = x - 1;
y1 = y - 1; y2 = y + 1;
if(Id.count({x1, y1}) && Id.count({x2, y2})) {
int u = Id[{x1, y1}], v = Id[{x2, y2}];
U.push_back(u);
V.push_back(v);
RA.push_back(x);
RB.push_back(y);
Sol.join(u, v);
continue;
}
} else {
//leg la ceva orizontal
int x1, y1, x2, y2;
y1 = y2 = y + 1;
x1 = x - 1; x2 = x + 1;
if(Id.count({x1, y1}) && Id.count({x2, y2})) {
int u = Id[{x1, y1}], v = Id[{x2, y2}];
U.push_back(u);
V.push_back(v);
RA.push_back(x);
RB.push_back(y);
Sol.join(u, v);
continue;
}
y1 = y2 = y - 1;
x1 = x - 1; x2 = x + 1;
if(Id.count({x1, y1}) && Id.count({x2, y2})) {
int u = Id[{x1, y1}], v = Id[{x2, y2}];
U.push_back(u);
V.push_back(v);
RA.push_back(x);
RB.push_back(y);
Sol.join(u, v);
continue;
}
}
}
if(Sol.nrc != 1) return 0;
build(U, V, RA, RB);
return 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 |
0 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 |
186 ms |
30864 KB |
Output is correct |
10 |
Correct |
13 ms |
3292 KB |
Output is correct |
11 |
Correct |
85 ms |
16332 KB |
Output is correct |
12 |
Correct |
20 ms |
4824 KB |
Output is correct |
13 |
Correct |
66 ms |
12568 KB |
Output is correct |
14 |
Correct |
1 ms |
600 KB |
Output is correct |
15 |
Correct |
3 ms |
892 KB |
Output is correct |
16 |
Correct |
181 ms |
29980 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 |
0 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 |
186 ms |
30864 KB |
Output is correct |
10 |
Correct |
13 ms |
3292 KB |
Output is correct |
11 |
Correct |
85 ms |
16332 KB |
Output is correct |
12 |
Correct |
20 ms |
4824 KB |
Output is correct |
13 |
Correct |
66 ms |
12568 KB |
Output is correct |
14 |
Correct |
1 ms |
600 KB |
Output is correct |
15 |
Correct |
3 ms |
892 KB |
Output is correct |
16 |
Correct |
181 ms |
29980 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 |
384 KB |
Output is correct |
20 |
Correct |
0 ms |
436 KB |
Output is correct |
21 |
Correct |
0 ms |
348 KB |
Output is correct |
22 |
Correct |
0 ms |
348 KB |
Output is correct |
23 |
Correct |
477 ms |
57208 KB |
Output is correct |
24 |
Correct |
0 ms |
344 KB |
Output is correct |
25 |
Correct |
2 ms |
604 KB |
Output is correct |
26 |
Correct |
4 ms |
988 KB |
Output is correct |
27 |
Correct |
5 ms |
1424 KB |
Output is correct |
28 |
Correct |
162 ms |
23172 KB |
Output is correct |
29 |
Correct |
263 ms |
36028 KB |
Output is correct |
30 |
Correct |
385 ms |
46080 KB |
Output is correct |
31 |
Correct |
481 ms |
57264 KB |
Output is correct |
32 |
Correct |
0 ms |
348 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 |
0 ms |
348 KB |
Output is correct |
42 |
Correct |
0 ms |
348 KB |
Output is correct |
43 |
Correct |
2 ms |
860 KB |
Output is correct |
44 |
Correct |
3 ms |
1116 KB |
Output is correct |
45 |
Correct |
192 ms |
27064 KB |
Output is correct |
46 |
Correct |
304 ms |
39096 KB |
Output is correct |
47 |
Correct |
302 ms |
39344 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 |
0 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 |
186 ms |
30864 KB |
Output is correct |
10 |
Correct |
13 ms |
3292 KB |
Output is correct |
11 |
Correct |
85 ms |
16332 KB |
Output is correct |
12 |
Correct |
20 ms |
4824 KB |
Output is correct |
13 |
Correct |
66 ms |
12568 KB |
Output is correct |
14 |
Correct |
1 ms |
600 KB |
Output is correct |
15 |
Correct |
3 ms |
892 KB |
Output is correct |
16 |
Correct |
181 ms |
29980 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 |
384 KB |
Output is correct |
20 |
Correct |
0 ms |
436 KB |
Output is correct |
21 |
Correct |
0 ms |
348 KB |
Output is correct |
22 |
Correct |
0 ms |
348 KB |
Output is correct |
23 |
Correct |
477 ms |
57208 KB |
Output is correct |
24 |
Correct |
0 ms |
344 KB |
Output is correct |
25 |
Correct |
2 ms |
604 KB |
Output is correct |
26 |
Correct |
4 ms |
988 KB |
Output is correct |
27 |
Correct |
5 ms |
1424 KB |
Output is correct |
28 |
Correct |
162 ms |
23172 KB |
Output is correct |
29 |
Correct |
263 ms |
36028 KB |
Output is correct |
30 |
Correct |
385 ms |
46080 KB |
Output is correct |
31 |
Correct |
481 ms |
57264 KB |
Output is correct |
32 |
Correct |
0 ms |
348 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 |
0 ms |
348 KB |
Output is correct |
42 |
Correct |
0 ms |
348 KB |
Output is correct |
43 |
Correct |
2 ms |
860 KB |
Output is correct |
44 |
Correct |
3 ms |
1116 KB |
Output is correct |
45 |
Correct |
192 ms |
27064 KB |
Output is correct |
46 |
Correct |
304 ms |
39096 KB |
Output is correct |
47 |
Correct |
302 ms |
39344 KB |
Output is correct |
48 |
Correct |
0 ms |
344 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 |
348 KB |
Output is correct |
55 |
Correct |
512 ms |
55928 KB |
Output is correct |
56 |
Correct |
0 ms |
344 KB |
Output is correct |
57 |
Correct |
2 ms |
860 KB |
Output is correct |
58 |
Correct |
9 ms |
1888 KB |
Output is correct |
59 |
Correct |
16 ms |
2988 KB |
Output is correct |
60 |
Correct |
223 ms |
28948 KB |
Output is correct |
61 |
Correct |
312 ms |
38548 KB |
Output is correct |
62 |
Correct |
395 ms |
46764 KB |
Output is correct |
63 |
Correct |
527 ms |
56240 KB |
Output is correct |
64 |
Correct |
0 ms |
348 KB |
Output is correct |
65 |
Correct |
0 ms |
348 KB |
Output is correct |
66 |
Correct |
1 ms |
348 KB |
Output is correct |
67 |
Correct |
433 ms |
59792 KB |
Output is correct |
68 |
Correct |
420 ms |
61628 KB |
Output is correct |
69 |
Correct |
429 ms |
61180 KB |
Output is correct |
70 |
Correct |
6 ms |
1116 KB |
Output is correct |
71 |
Correct |
11 ms |
2272 KB |
Output is correct |
72 |
Correct |
196 ms |
25992 KB |
Output is correct |
73 |
Correct |
315 ms |
40888 KB |
Output is correct |
74 |
Correct |
455 ms |
52160 KB |
Output is correct |
75 |
Correct |
487 ms |
57532 KB |
Output is correct |
76 |
Correct |
444 ms |
61368 KB |
Output is correct |
77 |
Correct |
7 ms |
1500 KB |
Output is correct |
78 |
Correct |
12 ms |
2676 KB |
Output is correct |
79 |
Correct |
206 ms |
27160 KB |
Output is correct |
80 |
Correct |
343 ms |
41720 KB |
Output is correct |
81 |
Correct |
494 ms |
54064 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 |
0 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 |
186 ms |
30864 KB |
Output is correct |
10 |
Correct |
13 ms |
3292 KB |
Output is correct |
11 |
Correct |
85 ms |
16332 KB |
Output is correct |
12 |
Correct |
20 ms |
4824 KB |
Output is correct |
13 |
Correct |
66 ms |
12568 KB |
Output is correct |
14 |
Correct |
1 ms |
600 KB |
Output is correct |
15 |
Correct |
3 ms |
892 KB |
Output is correct |
16 |
Correct |
181 ms |
29980 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 |
396 ms |
48248 KB |
Output is correct |
21 |
Correct |
391 ms |
49848 KB |
Output is correct |
22 |
Correct |
424 ms |
48828 KB |
Output is correct |
23 |
Correct |
368 ms |
53112 KB |
Output is correct |
24 |
Correct |
183 ms |
18512 KB |
Output is correct |
25 |
Correct |
515 ms |
56996 KB |
Output is correct |
26 |
Correct |
460 ms |
55996 KB |
Output is correct |
27 |
Correct |
464 ms |
59844 KB |
Output is correct |
28 |
Correct |
521 ms |
60528 KB |
Output is correct |
29 |
Correct |
588 ms |
61040 KB |
Output is correct |
30 |
Correct |
580 ms |
60312 KB |
Output is correct |
31 |
Correct |
1 ms |
348 KB |
Output is correct |
32 |
Correct |
28 ms |
3944 KB |
Output is correct |
33 |
Correct |
91 ms |
9652 KB |
Output is correct |
34 |
Correct |
451 ms |
48436 KB |
Output is correct |
35 |
Correct |
14 ms |
2780 KB |
Output is correct |
36 |
Correct |
92 ms |
11736 KB |
Output is correct |
37 |
Correct |
195 ms |
23480 KB |
Output is correct |
38 |
Correct |
176 ms |
21696 KB |
Output is correct |
39 |
Correct |
230 ms |
28168 KB |
Output is correct |
40 |
Correct |
312 ms |
36532 KB |
Output is correct |
41 |
Correct |
406 ms |
44980 KB |
Output is correct |
42 |
Correct |
487 ms |
52152 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 |
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 |
1 ms |
344 KB |
Output is correct |
52 |
Correct |
0 ms |
348 KB |
Output is correct |
53 |
Correct |
0 ms |
348 KB |
Output is correct |
54 |
Correct |
3 ms |
860 KB |
Output is correct |
55 |
Correct |
4 ms |
1072 KB |
Output is correct |
56 |
Correct |
191 ms |
26452 KB |
Output is correct |
57 |
Correct |
304 ms |
40116 KB |
Output is correct |
58 |
Correct |
313 ms |
39348 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 |
418 ms |
61424 KB |
Output is correct |
63 |
Correct |
420 ms |
61372 KB |
Output is correct |
64 |
Correct |
428 ms |
61108 KB |
Output is correct |
65 |
Correct |
5 ms |
1244 KB |
Output is correct |
66 |
Correct |
12 ms |
2264 KB |
Output is correct |
67 |
Correct |
197 ms |
26516 KB |
Output is correct |
68 |
Correct |
313 ms |
40100 KB |
Output is correct |
69 |
Correct |
458 ms |
53440 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 |
0 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 |
186 ms |
30864 KB |
Output is correct |
10 |
Correct |
13 ms |
3292 KB |
Output is correct |
11 |
Correct |
85 ms |
16332 KB |
Output is correct |
12 |
Correct |
20 ms |
4824 KB |
Output is correct |
13 |
Correct |
66 ms |
12568 KB |
Output is correct |
14 |
Correct |
1 ms |
600 KB |
Output is correct |
15 |
Correct |
3 ms |
892 KB |
Output is correct |
16 |
Correct |
181 ms |
29980 KB |
Output is correct |
17 |
Correct |
443 ms |
61884 KB |
Output is correct |
18 |
Correct |
432 ms |
62024 KB |
Output is correct |
19 |
Correct |
446 ms |
48956 KB |
Output is correct |
20 |
Correct |
508 ms |
54716 KB |
Output is correct |
21 |
Correct |
438 ms |
52368 KB |
Output is correct |
22 |
Correct |
0 ms |
344 KB |
Output is correct |
23 |
Correct |
64 ms |
8896 KB |
Output is correct |
24 |
Correct |
33 ms |
5244 KB |
Output is correct |
25 |
Correct |
132 ms |
18636 KB |
Output is correct |
26 |
Correct |
254 ms |
31928 KB |
Output is correct |
27 |
Correct |
224 ms |
27484 KB |
Output is correct |
28 |
Correct |
313 ms |
36832 KB |
Output is correct |
29 |
Correct |
384 ms |
42400 KB |
Output is correct |
30 |
Correct |
455 ms |
48932 KB |
Output is correct |
31 |
Correct |
591 ms |
54708 KB |
Output is correct |
32 |
Correct |
503 ms |
57368 KB |
Output is correct |
33 |
Correct |
431 ms |
60604 KB |
Output is correct |
34 |
Correct |
7 ms |
1500 KB |
Output is correct |
35 |
Correct |
13 ms |
2596 KB |
Output is correct |
36 |
Correct |
209 ms |
27224 KB |
Output is correct |
37 |
Correct |
336 ms |
42148 KB |
Output is correct |
38 |
Correct |
491 ms |
54000 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 |
0 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 |
186 ms |
30864 KB |
Output is correct |
10 |
Correct |
13 ms |
3292 KB |
Output is correct |
11 |
Correct |
85 ms |
16332 KB |
Output is correct |
12 |
Correct |
20 ms |
4824 KB |
Output is correct |
13 |
Correct |
66 ms |
12568 KB |
Output is correct |
14 |
Correct |
1 ms |
600 KB |
Output is correct |
15 |
Correct |
3 ms |
892 KB |
Output is correct |
16 |
Correct |
181 ms |
29980 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 |
384 KB |
Output is correct |
20 |
Correct |
0 ms |
436 KB |
Output is correct |
21 |
Correct |
0 ms |
348 KB |
Output is correct |
22 |
Correct |
0 ms |
348 KB |
Output is correct |
23 |
Correct |
477 ms |
57208 KB |
Output is correct |
24 |
Correct |
0 ms |
344 KB |
Output is correct |
25 |
Correct |
2 ms |
604 KB |
Output is correct |
26 |
Correct |
4 ms |
988 KB |
Output is correct |
27 |
Correct |
5 ms |
1424 KB |
Output is correct |
28 |
Correct |
162 ms |
23172 KB |
Output is correct |
29 |
Correct |
263 ms |
36028 KB |
Output is correct |
30 |
Correct |
385 ms |
46080 KB |
Output is correct |
31 |
Correct |
481 ms |
57264 KB |
Output is correct |
32 |
Correct |
0 ms |
348 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 |
0 ms |
348 KB |
Output is correct |
42 |
Correct |
0 ms |
348 KB |
Output is correct |
43 |
Correct |
2 ms |
860 KB |
Output is correct |
44 |
Correct |
3 ms |
1116 KB |
Output is correct |
45 |
Correct |
192 ms |
27064 KB |
Output is correct |
46 |
Correct |
304 ms |
39096 KB |
Output is correct |
47 |
Correct |
302 ms |
39344 KB |
Output is correct |
48 |
Correct |
0 ms |
344 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 |
348 KB |
Output is correct |
55 |
Correct |
512 ms |
55928 KB |
Output is correct |
56 |
Correct |
0 ms |
344 KB |
Output is correct |
57 |
Correct |
2 ms |
860 KB |
Output is correct |
58 |
Correct |
9 ms |
1888 KB |
Output is correct |
59 |
Correct |
16 ms |
2988 KB |
Output is correct |
60 |
Correct |
223 ms |
28948 KB |
Output is correct |
61 |
Correct |
312 ms |
38548 KB |
Output is correct |
62 |
Correct |
395 ms |
46764 KB |
Output is correct |
63 |
Correct |
527 ms |
56240 KB |
Output is correct |
64 |
Correct |
0 ms |
348 KB |
Output is correct |
65 |
Correct |
0 ms |
348 KB |
Output is correct |
66 |
Correct |
1 ms |
348 KB |
Output is correct |
67 |
Correct |
433 ms |
59792 KB |
Output is correct |
68 |
Correct |
420 ms |
61628 KB |
Output is correct |
69 |
Correct |
429 ms |
61180 KB |
Output is correct |
70 |
Correct |
6 ms |
1116 KB |
Output is correct |
71 |
Correct |
11 ms |
2272 KB |
Output is correct |
72 |
Correct |
196 ms |
25992 KB |
Output is correct |
73 |
Correct |
315 ms |
40888 KB |
Output is correct |
74 |
Correct |
455 ms |
52160 KB |
Output is correct |
75 |
Correct |
487 ms |
57532 KB |
Output is correct |
76 |
Correct |
444 ms |
61368 KB |
Output is correct |
77 |
Correct |
7 ms |
1500 KB |
Output is correct |
78 |
Correct |
12 ms |
2676 KB |
Output is correct |
79 |
Correct |
206 ms |
27160 KB |
Output is correct |
80 |
Correct |
343 ms |
41720 KB |
Output is correct |
81 |
Correct |
494 ms |
54064 KB |
Output is correct |
82 |
Correct |
0 ms |
348 KB |
Output is correct |
83 |
Correct |
0 ms |
348 KB |
Output is correct |
84 |
Correct |
0 ms |
348 KB |
Output is correct |
85 |
Correct |
396 ms |
48248 KB |
Output is correct |
86 |
Correct |
391 ms |
49848 KB |
Output is correct |
87 |
Correct |
424 ms |
48828 KB |
Output is correct |
88 |
Correct |
368 ms |
53112 KB |
Output is correct |
89 |
Correct |
183 ms |
18512 KB |
Output is correct |
90 |
Correct |
515 ms |
56996 KB |
Output is correct |
91 |
Correct |
460 ms |
55996 KB |
Output is correct |
92 |
Correct |
464 ms |
59844 KB |
Output is correct |
93 |
Correct |
521 ms |
60528 KB |
Output is correct |
94 |
Correct |
588 ms |
61040 KB |
Output is correct |
95 |
Correct |
580 ms |
60312 KB |
Output is correct |
96 |
Correct |
1 ms |
348 KB |
Output is correct |
97 |
Correct |
28 ms |
3944 KB |
Output is correct |
98 |
Correct |
91 ms |
9652 KB |
Output is correct |
99 |
Correct |
451 ms |
48436 KB |
Output is correct |
100 |
Correct |
14 ms |
2780 KB |
Output is correct |
101 |
Correct |
92 ms |
11736 KB |
Output is correct |
102 |
Correct |
195 ms |
23480 KB |
Output is correct |
103 |
Correct |
176 ms |
21696 KB |
Output is correct |
104 |
Correct |
230 ms |
28168 KB |
Output is correct |
105 |
Correct |
312 ms |
36532 KB |
Output is correct |
106 |
Correct |
406 ms |
44980 KB |
Output is correct |
107 |
Correct |
487 ms |
52152 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 |
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 |
1 ms |
344 KB |
Output is correct |
117 |
Correct |
0 ms |
348 KB |
Output is correct |
118 |
Correct |
0 ms |
348 KB |
Output is correct |
119 |
Correct |
3 ms |
860 KB |
Output is correct |
120 |
Correct |
4 ms |
1072 KB |
Output is correct |
121 |
Correct |
191 ms |
26452 KB |
Output is correct |
122 |
Correct |
304 ms |
40116 KB |
Output is correct |
123 |
Correct |
313 ms |
39348 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 |
418 ms |
61424 KB |
Output is correct |
128 |
Correct |
420 ms |
61372 KB |
Output is correct |
129 |
Correct |
428 ms |
61108 KB |
Output is correct |
130 |
Correct |
5 ms |
1244 KB |
Output is correct |
131 |
Correct |
12 ms |
2264 KB |
Output is correct |
132 |
Correct |
197 ms |
26516 KB |
Output is correct |
133 |
Correct |
313 ms |
40100 KB |
Output is correct |
134 |
Correct |
458 ms |
53440 KB |
Output is correct |
135 |
Correct |
443 ms |
61884 KB |
Output is correct |
136 |
Correct |
432 ms |
62024 KB |
Output is correct |
137 |
Correct |
446 ms |
48956 KB |
Output is correct |
138 |
Correct |
508 ms |
54716 KB |
Output is correct |
139 |
Correct |
438 ms |
52368 KB |
Output is correct |
140 |
Correct |
0 ms |
344 KB |
Output is correct |
141 |
Correct |
64 ms |
8896 KB |
Output is correct |
142 |
Correct |
33 ms |
5244 KB |
Output is correct |
143 |
Correct |
132 ms |
18636 KB |
Output is correct |
144 |
Correct |
254 ms |
31928 KB |
Output is correct |
145 |
Correct |
224 ms |
27484 KB |
Output is correct |
146 |
Correct |
313 ms |
36832 KB |
Output is correct |
147 |
Correct |
384 ms |
42400 KB |
Output is correct |
148 |
Correct |
455 ms |
48932 KB |
Output is correct |
149 |
Correct |
591 ms |
54708 KB |
Output is correct |
150 |
Correct |
503 ms |
57368 KB |
Output is correct |
151 |
Correct |
431 ms |
60604 KB |
Output is correct |
152 |
Correct |
7 ms |
1500 KB |
Output is correct |
153 |
Correct |
13 ms |
2596 KB |
Output is correct |
154 |
Correct |
209 ms |
27224 KB |
Output is correct |
155 |
Correct |
336 ms |
42148 KB |
Output is correct |
156 |
Correct |
491 ms |
54000 KB |
Output is correct |
157 |
Correct |
0 ms |
348 KB |
Output is correct |
158 |
Correct |
0 ms |
348 KB |
Output is correct |
159 |
Correct |
0 ms |
348 KB |
Output is correct |
160 |
Correct |
1 ms |
348 KB |
Output is correct |
161 |
Correct |
549 ms |
55724 KB |
Output is correct |
162 |
Correct |
425 ms |
49680 KB |
Output is correct |
163 |
Correct |
495 ms |
51292 KB |
Output is correct |
164 |
Correct |
469 ms |
50464 KB |
Output is correct |
165 |
Correct |
551 ms |
53676 KB |
Output is correct |
166 |
Correct |
626 ms |
54280 KB |
Output is correct |
167 |
Correct |
105 ms |
12920 KB |
Output is correct |
168 |
Correct |
67 ms |
7540 KB |
Output is correct |
169 |
Correct |
190 ms |
22328 KB |
Output is correct |
170 |
Correct |
426 ms |
38268 KB |
Output is correct |
171 |
Correct |
589 ms |
50452 KB |
Output is correct |
172 |
Correct |
280 ms |
28296 KB |
Output is correct |
173 |
Correct |
317 ms |
32588 KB |
Output is correct |
174 |
Correct |
381 ms |
39360 KB |
Output is correct |
175 |
Correct |
451 ms |
44464 KB |
Output is correct |
176 |
Correct |
483 ms |
49324 KB |
Output is correct |
177 |
Correct |
555 ms |
56248 KB |
Output is correct |