#include "parks.h"
#include <iostream>
#include <numeric>
#include <algorithm>
#include <utility>
#include <map>
#include <cassert>
using namespace std;
using vi = vector<int>;
using pi = pair<int, int>;
struct Dsu {
vector<int> rnk, par;
Dsu(int n) : rnk(n, 1), par(n) {
iota(par.begin(), par.end(), 0);
}
int root(int v) {
return v == par[v] ? v : par[v] = root(par[v]);
}
bool same(int a, int b) {
return root(a) == root(b);
}
bool unite(int a, int b) {
a = root(a), b = root(b);
if (a == b) {
return false;
} else {
if (rnk[a] < rnk[b]) swap(a, b);
rnk[a] += rnk[b];
par[b] = a;
return true;
}
}
};
int construct_roads(std::vector<int> x, std::vector<int> y) {
const int n = x.size();
vector<int> p(n);
iota(p.begin(), p.end(), 0);
sort(p.begin(), p.end(), [&](int i, int j) {
return make_pair(x[i], y[i]) < make_pair(x[j], y[j]);
});
map<pi, int> ord;
for (int i = 0; i < n; ++i) {
ord[{x[i], y[i]}] = i;
}
Dsu dsu(n);
vi u, v, a, b;
int edges = 0;
auto get_id = [&](int x, int y) {
if (!ord.count({x, y})) return -1;
return ord[{x, y}];
};
auto get_chair = [&] (int x1, int y1, int x2, int y2) {
if ((x1 + y1) % 4) swap(x1, x2), swap(y1, y2);
const int x3 = x1 - (y2 - y1);
const int y3 = y1 + (x2 - x1);
return pi {(x2+x3)>>1, (y2+y3)>>1};
};
auto add_edge = [&](int x1, int y1, int x2, int y2) {
if (!ord.count({x1, y1}) || !ord.count({x2, y2})) return;
const int i = ord[{x1, y1}];
const int j = ord[{x2, y2}];
const auto [cx, cy] = get_chair(x1, y1, x2, y2);
if (dsu.unite(i, j)) {
u.push_back(i);
v.push_back(j);
a.push_back(cx);
b.push_back(cy);
edges++;
}
};
for (int i : p) {
const int px = x[i], py = y[i];
if (get_id(px-2, py-2) != -1 && get_id(px-2, py) != -1 && get_id(px, py-2) != -1) {
const auto [nx, ny] = get_chair(px, py, px-2, py);
if (nx != px - 1 || ny != py - 1) {
add_edge(px, py, px-2, py);
} else {
add_edge(px, py, px, py-2);
}
} else {
add_edge(px, py, px, py-2);
add_edge(px, py, px-2, py);
}
}
if (edges == n - 1) {
build(u, v, a, b);
return 1;
} else {
return 0;
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
0 ms |
304 KB |
Output is correct |
6 |
Correct |
0 ms |
212 KB |
Output is correct |
7 |
Correct |
1 ms |
212 KB |
Output is correct |
8 |
Correct |
1 ms |
212 KB |
Output is correct |
9 |
Correct |
155 ms |
14876 KB |
Output is correct |
10 |
Correct |
12 ms |
1976 KB |
Output is correct |
11 |
Correct |
72 ms |
8232 KB |
Output is correct |
12 |
Correct |
17 ms |
2740 KB |
Output is correct |
13 |
Correct |
45 ms |
5492 KB |
Output is correct |
14 |
Correct |
1 ms |
340 KB |
Output is correct |
15 |
Correct |
3 ms |
468 KB |
Output is correct |
16 |
Correct |
156 ms |
14896 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
0 ms |
304 KB |
Output is correct |
6 |
Correct |
0 ms |
212 KB |
Output is correct |
7 |
Correct |
1 ms |
212 KB |
Output is correct |
8 |
Correct |
1 ms |
212 KB |
Output is correct |
9 |
Correct |
155 ms |
14876 KB |
Output is correct |
10 |
Correct |
12 ms |
1976 KB |
Output is correct |
11 |
Correct |
72 ms |
8232 KB |
Output is correct |
12 |
Correct |
17 ms |
2740 KB |
Output is correct |
13 |
Correct |
45 ms |
5492 KB |
Output is correct |
14 |
Correct |
1 ms |
340 KB |
Output is correct |
15 |
Correct |
3 ms |
468 KB |
Output is correct |
16 |
Correct |
156 ms |
14896 KB |
Output is correct |
17 |
Correct |
1 ms |
212 KB |
Output is correct |
18 |
Correct |
1 ms |
212 KB |
Output is correct |
19 |
Correct |
1 ms |
212 KB |
Output is correct |
20 |
Correct |
1 ms |
304 KB |
Output is correct |
21 |
Correct |
0 ms |
212 KB |
Output is correct |
22 |
Correct |
1 ms |
212 KB |
Output is correct |
23 |
Correct |
386 ms |
29424 KB |
Output is correct |
24 |
Correct |
1 ms |
304 KB |
Output is correct |
25 |
Correct |
2 ms |
468 KB |
Output is correct |
26 |
Correct |
3 ms |
568 KB |
Output is correct |
27 |
Correct |
4 ms |
724 KB |
Output is correct |
28 |
Correct |
126 ms |
12044 KB |
Output is correct |
29 |
Correct |
207 ms |
18004 KB |
Output is correct |
30 |
Correct |
308 ms |
23664 KB |
Output is correct |
31 |
Correct |
406 ms |
29496 KB |
Output is correct |
32 |
Correct |
0 ms |
212 KB |
Output is correct |
33 |
Correct |
1 ms |
212 KB |
Output is correct |
34 |
Correct |
1 ms |
212 KB |
Output is correct |
35 |
Correct |
1 ms |
212 KB |
Output is correct |
36 |
Correct |
1 ms |
212 KB |
Output is correct |
37 |
Correct |
1 ms |
212 KB |
Output is correct |
38 |
Correct |
1 ms |
212 KB |
Output is correct |
39 |
Correct |
1 ms |
212 KB |
Output is correct |
40 |
Correct |
1 ms |
212 KB |
Output is correct |
41 |
Correct |
0 ms |
212 KB |
Output is correct |
42 |
Correct |
0 ms |
212 KB |
Output is correct |
43 |
Correct |
2 ms |
468 KB |
Output is correct |
44 |
Correct |
4 ms |
596 KB |
Output is correct |
45 |
Correct |
161 ms |
15000 KB |
Output is correct |
46 |
Correct |
271 ms |
21548 KB |
Output is correct |
47 |
Correct |
245 ms |
21596 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
0 ms |
304 KB |
Output is correct |
6 |
Correct |
0 ms |
212 KB |
Output is correct |
7 |
Correct |
1 ms |
212 KB |
Output is correct |
8 |
Correct |
1 ms |
212 KB |
Output is correct |
9 |
Correct |
155 ms |
14876 KB |
Output is correct |
10 |
Correct |
12 ms |
1976 KB |
Output is correct |
11 |
Correct |
72 ms |
8232 KB |
Output is correct |
12 |
Correct |
17 ms |
2740 KB |
Output is correct |
13 |
Correct |
45 ms |
5492 KB |
Output is correct |
14 |
Correct |
1 ms |
340 KB |
Output is correct |
15 |
Correct |
3 ms |
468 KB |
Output is correct |
16 |
Correct |
156 ms |
14896 KB |
Output is correct |
17 |
Correct |
1 ms |
212 KB |
Output is correct |
18 |
Correct |
1 ms |
212 KB |
Output is correct |
19 |
Correct |
1 ms |
212 KB |
Output is correct |
20 |
Correct |
1 ms |
304 KB |
Output is correct |
21 |
Correct |
0 ms |
212 KB |
Output is correct |
22 |
Correct |
1 ms |
212 KB |
Output is correct |
23 |
Correct |
386 ms |
29424 KB |
Output is correct |
24 |
Correct |
1 ms |
304 KB |
Output is correct |
25 |
Correct |
2 ms |
468 KB |
Output is correct |
26 |
Correct |
3 ms |
568 KB |
Output is correct |
27 |
Correct |
4 ms |
724 KB |
Output is correct |
28 |
Correct |
126 ms |
12044 KB |
Output is correct |
29 |
Correct |
207 ms |
18004 KB |
Output is correct |
30 |
Correct |
308 ms |
23664 KB |
Output is correct |
31 |
Correct |
406 ms |
29496 KB |
Output is correct |
32 |
Correct |
0 ms |
212 KB |
Output is correct |
33 |
Correct |
1 ms |
212 KB |
Output is correct |
34 |
Correct |
1 ms |
212 KB |
Output is correct |
35 |
Correct |
1 ms |
212 KB |
Output is correct |
36 |
Correct |
1 ms |
212 KB |
Output is correct |
37 |
Correct |
1 ms |
212 KB |
Output is correct |
38 |
Correct |
1 ms |
212 KB |
Output is correct |
39 |
Correct |
1 ms |
212 KB |
Output is correct |
40 |
Correct |
1 ms |
212 KB |
Output is correct |
41 |
Correct |
0 ms |
212 KB |
Output is correct |
42 |
Correct |
0 ms |
212 KB |
Output is correct |
43 |
Correct |
2 ms |
468 KB |
Output is correct |
44 |
Correct |
4 ms |
596 KB |
Output is correct |
45 |
Correct |
161 ms |
15000 KB |
Output is correct |
46 |
Correct |
271 ms |
21548 KB |
Output is correct |
47 |
Correct |
245 ms |
21596 KB |
Output is correct |
48 |
Correct |
1 ms |
212 KB |
Output is correct |
49 |
Correct |
1 ms |
212 KB |
Output is correct |
50 |
Correct |
0 ms |
304 KB |
Output is correct |
51 |
Correct |
1 ms |
304 KB |
Output is correct |
52 |
Correct |
1 ms |
212 KB |
Output is correct |
53 |
Correct |
1 ms |
212 KB |
Output is correct |
54 |
Correct |
1 ms |
212 KB |
Output is correct |
55 |
Correct |
393 ms |
29448 KB |
Output is correct |
56 |
Correct |
1 ms |
212 KB |
Output is correct |
57 |
Correct |
3 ms |
596 KB |
Output is correct |
58 |
Correct |
11 ms |
1232 KB |
Output is correct |
59 |
Correct |
14 ms |
1492 KB |
Output is correct |
60 |
Correct |
178 ms |
14816 KB |
Output is correct |
61 |
Correct |
231 ms |
19972 KB |
Output is correct |
62 |
Correct |
313 ms |
24616 KB |
Output is correct |
63 |
Correct |
423 ms |
29480 KB |
Output is correct |
64 |
Correct |
1 ms |
212 KB |
Output is correct |
65 |
Correct |
1 ms |
212 KB |
Output is correct |
66 |
Correct |
0 ms |
212 KB |
Output is correct |
67 |
Correct |
341 ms |
29492 KB |
Output is correct |
68 |
Correct |
362 ms |
29516 KB |
Output is correct |
69 |
Correct |
344 ms |
29460 KB |
Output is correct |
70 |
Correct |
5 ms |
724 KB |
Output is correct |
71 |
Correct |
12 ms |
1192 KB |
Output is correct |
72 |
Correct |
173 ms |
14852 KB |
Output is correct |
73 |
Correct |
261 ms |
22256 KB |
Output is correct |
74 |
Correct |
422 ms |
29476 KB |
Output is correct |
75 |
Correct |
411 ms |
29372 KB |
Output is correct |
76 |
Correct |
400 ms |
29476 KB |
Output is correct |
77 |
Correct |
5 ms |
852 KB |
Output is correct |
78 |
Correct |
12 ms |
1372 KB |
Output is correct |
79 |
Correct |
173 ms |
14880 KB |
Output is correct |
80 |
Correct |
275 ms |
22272 KB |
Output is correct |
81 |
Correct |
404 ms |
29476 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
0 ms |
304 KB |
Output is correct |
6 |
Correct |
0 ms |
212 KB |
Output is correct |
7 |
Correct |
1 ms |
212 KB |
Output is correct |
8 |
Correct |
1 ms |
212 KB |
Output is correct |
9 |
Correct |
155 ms |
14876 KB |
Output is correct |
10 |
Correct |
12 ms |
1976 KB |
Output is correct |
11 |
Correct |
72 ms |
8232 KB |
Output is correct |
12 |
Correct |
17 ms |
2740 KB |
Output is correct |
13 |
Correct |
45 ms |
5492 KB |
Output is correct |
14 |
Correct |
1 ms |
340 KB |
Output is correct |
15 |
Correct |
3 ms |
468 KB |
Output is correct |
16 |
Correct |
156 ms |
14896 KB |
Output is correct |
17 |
Correct |
0 ms |
212 KB |
Output is correct |
18 |
Correct |
1 ms |
304 KB |
Output is correct |
19 |
Correct |
1 ms |
300 KB |
Output is correct |
20 |
Correct |
365 ms |
30380 KB |
Output is correct |
21 |
Correct |
431 ms |
30120 KB |
Output is correct |
22 |
Correct |
353 ms |
30104 KB |
Output is correct |
23 |
Correct |
299 ms |
25496 KB |
Output is correct |
24 |
Correct |
241 ms |
20028 KB |
Output is correct |
25 |
Correct |
317 ms |
23088 KB |
Output is correct |
26 |
Correct |
322 ms |
23100 KB |
Output is correct |
27 |
Correct |
369 ms |
29464 KB |
Output is correct |
28 |
Correct |
349 ms |
29420 KB |
Output is correct |
29 |
Correct |
384 ms |
29472 KB |
Output is correct |
30 |
Correct |
437 ms |
29476 KB |
Output is correct |
31 |
Correct |
1 ms |
212 KB |
Output is correct |
32 |
Correct |
21 ms |
2760 KB |
Output is correct |
33 |
Correct |
111 ms |
10564 KB |
Output is correct |
34 |
Correct |
426 ms |
30352 KB |
Output is correct |
35 |
Correct |
11 ms |
1620 KB |
Output is correct |
36 |
Correct |
66 ms |
6320 KB |
Output is correct |
37 |
Correct |
144 ms |
12260 KB |
Output is correct |
38 |
Correct |
138 ms |
12508 KB |
Output is correct |
39 |
Correct |
206 ms |
16868 KB |
Output is correct |
40 |
Correct |
268 ms |
21308 KB |
Output is correct |
41 |
Correct |
360 ms |
25864 KB |
Output is correct |
42 |
Correct |
436 ms |
30408 KB |
Output is correct |
43 |
Correct |
1 ms |
212 KB |
Output is correct |
44 |
Correct |
1 ms |
304 KB |
Output is correct |
45 |
Correct |
1 ms |
308 KB |
Output is correct |
46 |
Correct |
1 ms |
212 KB |
Output is correct |
47 |
Correct |
1 ms |
212 KB |
Output is correct |
48 |
Correct |
1 ms |
212 KB |
Output is correct |
49 |
Correct |
1 ms |
300 KB |
Output is correct |
50 |
Correct |
1 ms |
212 KB |
Output is correct |
51 |
Correct |
1 ms |
212 KB |
Output is correct |
52 |
Correct |
1 ms |
212 KB |
Output is correct |
53 |
Correct |
1 ms |
212 KB |
Output is correct |
54 |
Correct |
2 ms |
468 KB |
Output is correct |
55 |
Correct |
4 ms |
608 KB |
Output is correct |
56 |
Correct |
179 ms |
14900 KB |
Output is correct |
57 |
Correct |
267 ms |
21468 KB |
Output is correct |
58 |
Correct |
290 ms |
21424 KB |
Output is correct |
59 |
Correct |
1 ms |
212 KB |
Output is correct |
60 |
Correct |
1 ms |
212 KB |
Output is correct |
61 |
Correct |
1 ms |
212 KB |
Output is correct |
62 |
Correct |
396 ms |
29584 KB |
Output is correct |
63 |
Correct |
360 ms |
29456 KB |
Output is correct |
64 |
Correct |
335 ms |
29328 KB |
Output is correct |
65 |
Correct |
5 ms |
724 KB |
Output is correct |
66 |
Correct |
9 ms |
1208 KB |
Output is correct |
67 |
Correct |
175 ms |
14880 KB |
Output is correct |
68 |
Correct |
265 ms |
22312 KB |
Output is correct |
69 |
Correct |
430 ms |
29524 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
0 ms |
304 KB |
Output is correct |
6 |
Correct |
0 ms |
212 KB |
Output is correct |
7 |
Correct |
1 ms |
212 KB |
Output is correct |
8 |
Correct |
1 ms |
212 KB |
Output is correct |
9 |
Correct |
155 ms |
14876 KB |
Output is correct |
10 |
Correct |
12 ms |
1976 KB |
Output is correct |
11 |
Correct |
72 ms |
8232 KB |
Output is correct |
12 |
Correct |
17 ms |
2740 KB |
Output is correct |
13 |
Correct |
45 ms |
5492 KB |
Output is correct |
14 |
Correct |
1 ms |
340 KB |
Output is correct |
15 |
Correct |
3 ms |
468 KB |
Output is correct |
16 |
Correct |
156 ms |
14896 KB |
Output is correct |
17 |
Correct |
371 ms |
29852 KB |
Output is correct |
18 |
Correct |
363 ms |
30008 KB |
Output is correct |
19 |
Correct |
384 ms |
30096 KB |
Output is correct |
20 |
Correct |
380 ms |
28708 KB |
Output is correct |
21 |
Correct |
314 ms |
25940 KB |
Output is correct |
22 |
Correct |
1 ms |
212 KB |
Output is correct |
23 |
Correct |
48 ms |
5336 KB |
Output is correct |
24 |
Correct |
25 ms |
2912 KB |
Output is correct |
25 |
Correct |
106 ms |
8888 KB |
Output is correct |
26 |
Correct |
191 ms |
14500 KB |
Output is correct |
27 |
Correct |
170 ms |
15488 KB |
Output is correct |
28 |
Correct |
239 ms |
19308 KB |
Output is correct |
29 |
Correct |
274 ms |
23076 KB |
Output is correct |
30 |
Correct |
367 ms |
26532 KB |
Output is correct |
31 |
Correct |
395 ms |
30492 KB |
Output is correct |
32 |
Correct |
373 ms |
29584 KB |
Output is correct |
33 |
Correct |
343 ms |
29420 KB |
Output is correct |
34 |
Correct |
7 ms |
852 KB |
Output is correct |
35 |
Correct |
13 ms |
1468 KB |
Output is correct |
36 |
Correct |
157 ms |
14804 KB |
Output is correct |
37 |
Correct |
282 ms |
22296 KB |
Output is correct |
38 |
Correct |
432 ms |
29476 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
0 ms |
304 KB |
Output is correct |
6 |
Correct |
0 ms |
212 KB |
Output is correct |
7 |
Correct |
1 ms |
212 KB |
Output is correct |
8 |
Correct |
1 ms |
212 KB |
Output is correct |
9 |
Correct |
155 ms |
14876 KB |
Output is correct |
10 |
Correct |
12 ms |
1976 KB |
Output is correct |
11 |
Correct |
72 ms |
8232 KB |
Output is correct |
12 |
Correct |
17 ms |
2740 KB |
Output is correct |
13 |
Correct |
45 ms |
5492 KB |
Output is correct |
14 |
Correct |
1 ms |
340 KB |
Output is correct |
15 |
Correct |
3 ms |
468 KB |
Output is correct |
16 |
Correct |
156 ms |
14896 KB |
Output is correct |
17 |
Correct |
1 ms |
212 KB |
Output is correct |
18 |
Correct |
1 ms |
212 KB |
Output is correct |
19 |
Correct |
1 ms |
212 KB |
Output is correct |
20 |
Correct |
1 ms |
304 KB |
Output is correct |
21 |
Correct |
0 ms |
212 KB |
Output is correct |
22 |
Correct |
1 ms |
212 KB |
Output is correct |
23 |
Correct |
386 ms |
29424 KB |
Output is correct |
24 |
Correct |
1 ms |
304 KB |
Output is correct |
25 |
Correct |
2 ms |
468 KB |
Output is correct |
26 |
Correct |
3 ms |
568 KB |
Output is correct |
27 |
Correct |
4 ms |
724 KB |
Output is correct |
28 |
Correct |
126 ms |
12044 KB |
Output is correct |
29 |
Correct |
207 ms |
18004 KB |
Output is correct |
30 |
Correct |
308 ms |
23664 KB |
Output is correct |
31 |
Correct |
406 ms |
29496 KB |
Output is correct |
32 |
Correct |
0 ms |
212 KB |
Output is correct |
33 |
Correct |
1 ms |
212 KB |
Output is correct |
34 |
Correct |
1 ms |
212 KB |
Output is correct |
35 |
Correct |
1 ms |
212 KB |
Output is correct |
36 |
Correct |
1 ms |
212 KB |
Output is correct |
37 |
Correct |
1 ms |
212 KB |
Output is correct |
38 |
Correct |
1 ms |
212 KB |
Output is correct |
39 |
Correct |
1 ms |
212 KB |
Output is correct |
40 |
Correct |
1 ms |
212 KB |
Output is correct |
41 |
Correct |
0 ms |
212 KB |
Output is correct |
42 |
Correct |
0 ms |
212 KB |
Output is correct |
43 |
Correct |
2 ms |
468 KB |
Output is correct |
44 |
Correct |
4 ms |
596 KB |
Output is correct |
45 |
Correct |
161 ms |
15000 KB |
Output is correct |
46 |
Correct |
271 ms |
21548 KB |
Output is correct |
47 |
Correct |
245 ms |
21596 KB |
Output is correct |
48 |
Correct |
1 ms |
212 KB |
Output is correct |
49 |
Correct |
1 ms |
212 KB |
Output is correct |
50 |
Correct |
0 ms |
304 KB |
Output is correct |
51 |
Correct |
1 ms |
304 KB |
Output is correct |
52 |
Correct |
1 ms |
212 KB |
Output is correct |
53 |
Correct |
1 ms |
212 KB |
Output is correct |
54 |
Correct |
1 ms |
212 KB |
Output is correct |
55 |
Correct |
393 ms |
29448 KB |
Output is correct |
56 |
Correct |
1 ms |
212 KB |
Output is correct |
57 |
Correct |
3 ms |
596 KB |
Output is correct |
58 |
Correct |
11 ms |
1232 KB |
Output is correct |
59 |
Correct |
14 ms |
1492 KB |
Output is correct |
60 |
Correct |
178 ms |
14816 KB |
Output is correct |
61 |
Correct |
231 ms |
19972 KB |
Output is correct |
62 |
Correct |
313 ms |
24616 KB |
Output is correct |
63 |
Correct |
423 ms |
29480 KB |
Output is correct |
64 |
Correct |
1 ms |
212 KB |
Output is correct |
65 |
Correct |
1 ms |
212 KB |
Output is correct |
66 |
Correct |
0 ms |
212 KB |
Output is correct |
67 |
Correct |
341 ms |
29492 KB |
Output is correct |
68 |
Correct |
362 ms |
29516 KB |
Output is correct |
69 |
Correct |
344 ms |
29460 KB |
Output is correct |
70 |
Correct |
5 ms |
724 KB |
Output is correct |
71 |
Correct |
12 ms |
1192 KB |
Output is correct |
72 |
Correct |
173 ms |
14852 KB |
Output is correct |
73 |
Correct |
261 ms |
22256 KB |
Output is correct |
74 |
Correct |
422 ms |
29476 KB |
Output is correct |
75 |
Correct |
411 ms |
29372 KB |
Output is correct |
76 |
Correct |
400 ms |
29476 KB |
Output is correct |
77 |
Correct |
5 ms |
852 KB |
Output is correct |
78 |
Correct |
12 ms |
1372 KB |
Output is correct |
79 |
Correct |
173 ms |
14880 KB |
Output is correct |
80 |
Correct |
275 ms |
22272 KB |
Output is correct |
81 |
Correct |
404 ms |
29476 KB |
Output is correct |
82 |
Correct |
0 ms |
212 KB |
Output is correct |
83 |
Correct |
1 ms |
304 KB |
Output is correct |
84 |
Correct |
1 ms |
300 KB |
Output is correct |
85 |
Correct |
365 ms |
30380 KB |
Output is correct |
86 |
Correct |
431 ms |
30120 KB |
Output is correct |
87 |
Correct |
353 ms |
30104 KB |
Output is correct |
88 |
Correct |
299 ms |
25496 KB |
Output is correct |
89 |
Correct |
241 ms |
20028 KB |
Output is correct |
90 |
Correct |
317 ms |
23088 KB |
Output is correct |
91 |
Correct |
322 ms |
23100 KB |
Output is correct |
92 |
Correct |
369 ms |
29464 KB |
Output is correct |
93 |
Correct |
349 ms |
29420 KB |
Output is correct |
94 |
Correct |
384 ms |
29472 KB |
Output is correct |
95 |
Correct |
437 ms |
29476 KB |
Output is correct |
96 |
Correct |
1 ms |
212 KB |
Output is correct |
97 |
Correct |
21 ms |
2760 KB |
Output is correct |
98 |
Correct |
111 ms |
10564 KB |
Output is correct |
99 |
Correct |
426 ms |
30352 KB |
Output is correct |
100 |
Correct |
11 ms |
1620 KB |
Output is correct |
101 |
Correct |
66 ms |
6320 KB |
Output is correct |
102 |
Correct |
144 ms |
12260 KB |
Output is correct |
103 |
Correct |
138 ms |
12508 KB |
Output is correct |
104 |
Correct |
206 ms |
16868 KB |
Output is correct |
105 |
Correct |
268 ms |
21308 KB |
Output is correct |
106 |
Correct |
360 ms |
25864 KB |
Output is correct |
107 |
Correct |
436 ms |
30408 KB |
Output is correct |
108 |
Correct |
1 ms |
212 KB |
Output is correct |
109 |
Correct |
1 ms |
304 KB |
Output is correct |
110 |
Correct |
1 ms |
308 KB |
Output is correct |
111 |
Correct |
1 ms |
212 KB |
Output is correct |
112 |
Correct |
1 ms |
212 KB |
Output is correct |
113 |
Correct |
1 ms |
212 KB |
Output is correct |
114 |
Correct |
1 ms |
300 KB |
Output is correct |
115 |
Correct |
1 ms |
212 KB |
Output is correct |
116 |
Correct |
1 ms |
212 KB |
Output is correct |
117 |
Correct |
1 ms |
212 KB |
Output is correct |
118 |
Correct |
1 ms |
212 KB |
Output is correct |
119 |
Correct |
2 ms |
468 KB |
Output is correct |
120 |
Correct |
4 ms |
608 KB |
Output is correct |
121 |
Correct |
179 ms |
14900 KB |
Output is correct |
122 |
Correct |
267 ms |
21468 KB |
Output is correct |
123 |
Correct |
290 ms |
21424 KB |
Output is correct |
124 |
Correct |
1 ms |
212 KB |
Output is correct |
125 |
Correct |
1 ms |
212 KB |
Output is correct |
126 |
Correct |
1 ms |
212 KB |
Output is correct |
127 |
Correct |
396 ms |
29584 KB |
Output is correct |
128 |
Correct |
360 ms |
29456 KB |
Output is correct |
129 |
Correct |
335 ms |
29328 KB |
Output is correct |
130 |
Correct |
5 ms |
724 KB |
Output is correct |
131 |
Correct |
9 ms |
1208 KB |
Output is correct |
132 |
Correct |
175 ms |
14880 KB |
Output is correct |
133 |
Correct |
265 ms |
22312 KB |
Output is correct |
134 |
Correct |
430 ms |
29524 KB |
Output is correct |
135 |
Correct |
371 ms |
29852 KB |
Output is correct |
136 |
Correct |
363 ms |
30008 KB |
Output is correct |
137 |
Correct |
384 ms |
30096 KB |
Output is correct |
138 |
Correct |
380 ms |
28708 KB |
Output is correct |
139 |
Correct |
314 ms |
25940 KB |
Output is correct |
140 |
Correct |
1 ms |
212 KB |
Output is correct |
141 |
Correct |
48 ms |
5336 KB |
Output is correct |
142 |
Correct |
25 ms |
2912 KB |
Output is correct |
143 |
Correct |
106 ms |
8888 KB |
Output is correct |
144 |
Correct |
191 ms |
14500 KB |
Output is correct |
145 |
Correct |
170 ms |
15488 KB |
Output is correct |
146 |
Correct |
239 ms |
19308 KB |
Output is correct |
147 |
Correct |
274 ms |
23076 KB |
Output is correct |
148 |
Correct |
367 ms |
26532 KB |
Output is correct |
149 |
Correct |
395 ms |
30492 KB |
Output is correct |
150 |
Correct |
373 ms |
29584 KB |
Output is correct |
151 |
Correct |
343 ms |
29420 KB |
Output is correct |
152 |
Correct |
7 ms |
852 KB |
Output is correct |
153 |
Correct |
13 ms |
1468 KB |
Output is correct |
154 |
Correct |
157 ms |
14804 KB |
Output is correct |
155 |
Correct |
282 ms |
22296 KB |
Output is correct |
156 |
Correct |
432 ms |
29476 KB |
Output is correct |
157 |
Correct |
1 ms |
340 KB |
Output is correct |
158 |
Correct |
1 ms |
212 KB |
Output is correct |
159 |
Correct |
1 ms |
212 KB |
Output is correct |
160 |
Correct |
1 ms |
212 KB |
Output is correct |
161 |
Correct |
426 ms |
29976 KB |
Output is correct |
162 |
Correct |
434 ms |
30520 KB |
Output is correct |
163 |
Correct |
413 ms |
30296 KB |
Output is correct |
164 |
Correct |
435 ms |
30216 KB |
Output is correct |
165 |
Correct |
430 ms |
30100 KB |
Output is correct |
166 |
Correct |
434 ms |
29860 KB |
Output is correct |
167 |
Correct |
85 ms |
7396 KB |
Output is correct |
168 |
Correct |
43 ms |
4132 KB |
Output is correct |
169 |
Correct |
116 ms |
10004 KB |
Output is correct |
170 |
Correct |
240 ms |
18356 KB |
Output is correct |
171 |
Correct |
375 ms |
23996 KB |
Output is correct |
172 |
Correct |
180 ms |
15400 KB |
Output is correct |
173 |
Correct |
243 ms |
18352 KB |
Output is correct |
174 |
Correct |
264 ms |
21348 KB |
Output is correct |
175 |
Correct |
322 ms |
24228 KB |
Output is correct |
176 |
Correct |
390 ms |
27336 KB |
Output is correct |
177 |
Correct |
426 ms |
30376 KB |
Output is correct |