#include "parks.h"
#include <set>
#include <map>
#include <vector>
#include <utility>
#include <algorithm>
using namespace std;
int uf[200006];
int _find(int x) {
if (uf[x] == -1) return x;
return uf[x] = _find(uf[x]);
}
bool _merge(int x, int y) {
x = _find(x), y = _find(y);
if (x != y) return uf[x] = y, true;
return false;
}
set<pair<int, int>> points;
map<pair<int, int>, int> fountains;
vector<pair<int, int>> edges, sel;
int construct_roads(vector<int> x, vector<int> y) {
int n = (int)x.size();
for (int i = 0; i < n; i++) uf[i] = -1;
for (int i = 0; i < n; i++) {
points.insert({ x[i] - 1, y[i] - 1 });
points.insert({ x[i] - 1, y[i] + 1 });
points.insert({ x[i] + 1, y[i] - 1 });
points.insert({ x[i] + 1, y[i] + 1 });
fountains[{ x[i], y[i] }] = i;
}
for (auto &i: points) {
if ((i.first / 2 + i.second / 2) % 2) {
bool pos = false;
if (!pos && fountains.find({ i.first - 1, i.second - 1 }) != fountains.end() && fountains.find({ i.first + 1, i.second - 1 }) != fountains.end()) {
int a = fountains[{ i.first - 1, i.second - 1 }], b = fountains[{ i.first + 1, i.second - 1 }];
if (_merge(a, b)) {
edges.push_back({ a, b });
sel.push_back(i);
pos = true;
}
}
if (!pos && fountains.find({ i.first - 1, i.second + 1 }) != fountains.end() && fountains.find({ i.first + 1, i.second + 1 }) != fountains.end()) {
int a = fountains[{ i.first - 1, i.second + 1 }], b = fountains[{ i.first + 1, i.second + 1 }];
if (_merge(a, b)) {
edges.push_back({ a, b });
sel.push_back(i);
pos = true;
}
}
} else {
bool pos = false;
if (!pos && fountains.find({ i.first - 1, i.second - 1 }) != fountains.end() && fountains.find({ i.first - 1, i.second + 1 }) != fountains.end()) {
int a = fountains[{ i.first - 1, i.second - 1 }], b = fountains[{ i.first - 1, i.second + 1 }];
if (_merge(a, b)) {
edges.push_back({ a, b });
sel.push_back(i);
pos = true;
}
}
if (!pos && fountains.find({ i.first + 1, i.second - 1 }) != fountains.end() && fountains.find({ i.first + 1, i.second + 1 }) != fountains.end()) {
int a = fountains[{ i.first + 1, i.second - 1 }], b = fountains[{ i.first + 1, i.second + 1 }];
if (_merge(a, b)) {
edges.push_back({ a, b });
sel.push_back(i);
pos = true;
}
}
}
}
if ((int)edges.size() < n - 1) return 0;
vector<int> u(n - 1), v(n - 1), a(n - 1), b(n - 1);
for (int i = 0; i < n - 1; i++) u[i] = edges[i].first, v[i] = edges[i].second, a[i] = sel[i].first, b[i] = sel[i].second;
build(u, v, a, b);
return 1;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
0 ms |
204 KB |
Output is correct |
3 |
Correct |
1 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 |
290 ms |
26112 KB |
Output is correct |
10 |
Correct |
19 ms |
2892 KB |
Output is correct |
11 |
Correct |
123 ms |
14196 KB |
Output is correct |
12 |
Correct |
30 ms |
4236 KB |
Output is correct |
13 |
Correct |
97 ms |
9236 KB |
Output is correct |
14 |
Correct |
2 ms |
460 KB |
Output is correct |
15 |
Correct |
3 ms |
588 KB |
Output is correct |
16 |
Correct |
313 ms |
26124 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
0 ms |
204 KB |
Output is correct |
3 |
Correct |
1 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 |
290 ms |
26112 KB |
Output is correct |
10 |
Correct |
19 ms |
2892 KB |
Output is correct |
11 |
Correct |
123 ms |
14196 KB |
Output is correct |
12 |
Correct |
30 ms |
4236 KB |
Output is correct |
13 |
Correct |
97 ms |
9236 KB |
Output is correct |
14 |
Correct |
2 ms |
460 KB |
Output is correct |
15 |
Correct |
3 ms |
588 KB |
Output is correct |
16 |
Correct |
313 ms |
26124 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 |
0 ms |
204 KB |
Output is correct |
21 |
Correct |
0 ms |
204 KB |
Output is correct |
22 |
Correct |
0 ms |
204 KB |
Output is correct |
23 |
Correct |
711 ms |
48928 KB |
Output is correct |
24 |
Correct |
0 ms |
204 KB |
Output is correct |
25 |
Correct |
2 ms |
460 KB |
Output is correct |
26 |
Correct |
5 ms |
844 KB |
Output is correct |
27 |
Correct |
6 ms |
972 KB |
Output is correct |
28 |
Correct |
213 ms |
19544 KB |
Output is correct |
29 |
Correct |
373 ms |
29648 KB |
Output is correct |
30 |
Correct |
544 ms |
39288 KB |
Output is correct |
31 |
Correct |
715 ms |
49044 KB |
Output is correct |
32 |
Correct |
0 ms |
204 KB |
Output is correct |
33 |
Correct |
0 ms |
204 KB |
Output is correct |
34 |
Correct |
1 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 |
0 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 |
4 ms |
588 KB |
Output is correct |
44 |
Correct |
5 ms |
904 KB |
Output is correct |
45 |
Correct |
322 ms |
26272 KB |
Output is correct |
46 |
Correct |
524 ms |
38028 KB |
Output is correct |
47 |
Correct |
516 ms |
38020 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
0 ms |
204 KB |
Output is correct |
3 |
Correct |
1 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 |
290 ms |
26112 KB |
Output is correct |
10 |
Correct |
19 ms |
2892 KB |
Output is correct |
11 |
Correct |
123 ms |
14196 KB |
Output is correct |
12 |
Correct |
30 ms |
4236 KB |
Output is correct |
13 |
Correct |
97 ms |
9236 KB |
Output is correct |
14 |
Correct |
2 ms |
460 KB |
Output is correct |
15 |
Correct |
3 ms |
588 KB |
Output is correct |
16 |
Correct |
313 ms |
26124 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 |
0 ms |
204 KB |
Output is correct |
21 |
Correct |
0 ms |
204 KB |
Output is correct |
22 |
Correct |
0 ms |
204 KB |
Output is correct |
23 |
Correct |
711 ms |
48928 KB |
Output is correct |
24 |
Correct |
0 ms |
204 KB |
Output is correct |
25 |
Correct |
2 ms |
460 KB |
Output is correct |
26 |
Correct |
5 ms |
844 KB |
Output is correct |
27 |
Correct |
6 ms |
972 KB |
Output is correct |
28 |
Correct |
213 ms |
19544 KB |
Output is correct |
29 |
Correct |
373 ms |
29648 KB |
Output is correct |
30 |
Correct |
544 ms |
39288 KB |
Output is correct |
31 |
Correct |
715 ms |
49044 KB |
Output is correct |
32 |
Correct |
0 ms |
204 KB |
Output is correct |
33 |
Correct |
0 ms |
204 KB |
Output is correct |
34 |
Correct |
1 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 |
0 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 |
4 ms |
588 KB |
Output is correct |
44 |
Correct |
5 ms |
904 KB |
Output is correct |
45 |
Correct |
322 ms |
26272 KB |
Output is correct |
46 |
Correct |
524 ms |
38028 KB |
Output is correct |
47 |
Correct |
516 ms |
38020 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 |
0 ms |
204 KB |
Output is correct |
55 |
Correct |
708 ms |
46900 KB |
Output is correct |
56 |
Correct |
0 ms |
204 KB |
Output is correct |
57 |
Correct |
3 ms |
588 KB |
Output is correct |
58 |
Correct |
12 ms |
1700 KB |
Output is correct |
59 |
Correct |
16 ms |
2080 KB |
Output is correct |
60 |
Correct |
309 ms |
23336 KB |
Output is correct |
61 |
Correct |
435 ms |
31600 KB |
Output is correct |
62 |
Correct |
554 ms |
38976 KB |
Output is correct |
63 |
Correct |
681 ms |
46976 KB |
Output is correct |
64 |
Correct |
0 ms |
204 KB |
Output is correct |
65 |
Correct |
0 ms |
204 KB |
Output is correct |
66 |
Correct |
0 ms |
284 KB |
Output is correct |
67 |
Correct |
693 ms |
52300 KB |
Output is correct |
68 |
Correct |
680 ms |
53012 KB |
Output is correct |
69 |
Correct |
692 ms |
52420 KB |
Output is correct |
70 |
Correct |
7 ms |
972 KB |
Output is correct |
71 |
Correct |
15 ms |
1872 KB |
Output is correct |
72 |
Correct |
323 ms |
25600 KB |
Output is correct |
73 |
Correct |
552 ms |
38708 KB |
Output is correct |
74 |
Correct |
755 ms |
51600 KB |
Output is correct |
75 |
Correct |
718 ms |
49628 KB |
Output is correct |
76 |
Correct |
685 ms |
53036 KB |
Output is correct |
77 |
Correct |
9 ms |
1228 KB |
Output is correct |
78 |
Correct |
17 ms |
2144 KB |
Output is correct |
79 |
Correct |
319 ms |
25152 KB |
Output is correct |
80 |
Correct |
513 ms |
37640 KB |
Output is correct |
81 |
Correct |
781 ms |
50148 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
0 ms |
204 KB |
Output is correct |
3 |
Correct |
1 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 |
290 ms |
26112 KB |
Output is correct |
10 |
Correct |
19 ms |
2892 KB |
Output is correct |
11 |
Correct |
123 ms |
14196 KB |
Output is correct |
12 |
Correct |
30 ms |
4236 KB |
Output is correct |
13 |
Correct |
97 ms |
9236 KB |
Output is correct |
14 |
Correct |
2 ms |
460 KB |
Output is correct |
15 |
Correct |
3 ms |
588 KB |
Output is correct |
16 |
Correct |
313 ms |
26124 KB |
Output is correct |
17 |
Correct |
0 ms |
288 KB |
Output is correct |
18 |
Correct |
0 ms |
204 KB |
Output is correct |
19 |
Correct |
0 ms |
204 KB |
Output is correct |
20 |
Correct |
697 ms |
53808 KB |
Output is correct |
21 |
Correct |
750 ms |
53648 KB |
Output is correct |
22 |
Correct |
733 ms |
53908 KB |
Output is correct |
23 |
Correct |
587 ms |
45504 KB |
Output is correct |
24 |
Correct |
675 ms |
56116 KB |
Output is correct |
25 |
Correct |
746 ms |
40476 KB |
Output is correct |
26 |
Correct |
602 ms |
40432 KB |
Output is correct |
27 |
Correct |
726 ms |
52352 KB |
Output is correct |
28 |
Correct |
676 ms |
52188 KB |
Output is correct |
29 |
Correct |
813 ms |
52188 KB |
Output is correct |
30 |
Correct |
780 ms |
52388 KB |
Output is correct |
31 |
Correct |
0 ms |
204 KB |
Output is correct |
32 |
Correct |
34 ms |
4032 KB |
Output is correct |
33 |
Correct |
271 ms |
23836 KB |
Output is correct |
34 |
Correct |
722 ms |
54052 KB |
Output is correct |
35 |
Correct |
19 ms |
2252 KB |
Output is correct |
36 |
Correct |
114 ms |
9960 KB |
Output is correct |
37 |
Correct |
292 ms |
19436 KB |
Output is correct |
38 |
Correct |
245 ms |
20664 KB |
Output is correct |
39 |
Correct |
361 ms |
28148 KB |
Output is correct |
40 |
Correct |
503 ms |
35924 KB |
Output is correct |
41 |
Correct |
624 ms |
43500 KB |
Output is correct |
42 |
Correct |
781 ms |
51084 KB |
Output is correct |
43 |
Correct |
1 ms |
204 KB |
Output is correct |
44 |
Correct |
0 ms |
204 KB |
Output is correct |
45 |
Correct |
1 ms |
204 KB |
Output is correct |
46 |
Correct |
1 ms |
268 KB |
Output is correct |
47 |
Correct |
0 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 |
0 ms |
204 KB |
Output is correct |
54 |
Correct |
4 ms |
588 KB |
Output is correct |
55 |
Correct |
5 ms |
844 KB |
Output is correct |
56 |
Correct |
343 ms |
26212 KB |
Output is correct |
57 |
Correct |
531 ms |
37968 KB |
Output is correct |
58 |
Correct |
525 ms |
38108 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 |
675 ms |
52352 KB |
Output is correct |
63 |
Correct |
681 ms |
53032 KB |
Output is correct |
64 |
Correct |
676 ms |
52464 KB |
Output is correct |
65 |
Correct |
7 ms |
972 KB |
Output is correct |
66 |
Correct |
15 ms |
1920 KB |
Output is correct |
67 |
Correct |
335 ms |
25696 KB |
Output is correct |
68 |
Correct |
530 ms |
38636 KB |
Output is correct |
69 |
Correct |
747 ms |
51564 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
0 ms |
204 KB |
Output is correct |
3 |
Correct |
1 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 |
290 ms |
26112 KB |
Output is correct |
10 |
Correct |
19 ms |
2892 KB |
Output is correct |
11 |
Correct |
123 ms |
14196 KB |
Output is correct |
12 |
Correct |
30 ms |
4236 KB |
Output is correct |
13 |
Correct |
97 ms |
9236 KB |
Output is correct |
14 |
Correct |
2 ms |
460 KB |
Output is correct |
15 |
Correct |
3 ms |
588 KB |
Output is correct |
16 |
Correct |
313 ms |
26124 KB |
Output is correct |
17 |
Correct |
720 ms |
53500 KB |
Output is correct |
18 |
Correct |
694 ms |
53536 KB |
Output is correct |
19 |
Correct |
707 ms |
53732 KB |
Output is correct |
20 |
Correct |
694 ms |
45148 KB |
Output is correct |
21 |
Correct |
638 ms |
44264 KB |
Output is correct |
22 |
Correct |
0 ms |
204 KB |
Output is correct |
23 |
Correct |
81 ms |
8352 KB |
Output is correct |
24 |
Correct |
45 ms |
4076 KB |
Output is correct |
25 |
Correct |
185 ms |
13584 KB |
Output is correct |
26 |
Correct |
359 ms |
22104 KB |
Output is correct |
27 |
Correct |
322 ms |
24736 KB |
Output is correct |
28 |
Correct |
440 ms |
31112 KB |
Output is correct |
29 |
Correct |
530 ms |
37268 KB |
Output is correct |
30 |
Correct |
627 ms |
42876 KB |
Output is correct |
31 |
Correct |
748 ms |
49380 KB |
Output is correct |
32 |
Correct |
728 ms |
49728 KB |
Output is correct |
33 |
Correct |
684 ms |
52968 KB |
Output is correct |
34 |
Correct |
9 ms |
1228 KB |
Output is correct |
35 |
Correct |
16 ms |
2024 KB |
Output is correct |
36 |
Correct |
313 ms |
24996 KB |
Output is correct |
37 |
Correct |
527 ms |
37712 KB |
Output is correct |
38 |
Correct |
739 ms |
50176 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
0 ms |
204 KB |
Output is correct |
3 |
Correct |
1 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 |
290 ms |
26112 KB |
Output is correct |
10 |
Correct |
19 ms |
2892 KB |
Output is correct |
11 |
Correct |
123 ms |
14196 KB |
Output is correct |
12 |
Correct |
30 ms |
4236 KB |
Output is correct |
13 |
Correct |
97 ms |
9236 KB |
Output is correct |
14 |
Correct |
2 ms |
460 KB |
Output is correct |
15 |
Correct |
3 ms |
588 KB |
Output is correct |
16 |
Correct |
313 ms |
26124 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 |
0 ms |
204 KB |
Output is correct |
21 |
Correct |
0 ms |
204 KB |
Output is correct |
22 |
Correct |
0 ms |
204 KB |
Output is correct |
23 |
Correct |
711 ms |
48928 KB |
Output is correct |
24 |
Correct |
0 ms |
204 KB |
Output is correct |
25 |
Correct |
2 ms |
460 KB |
Output is correct |
26 |
Correct |
5 ms |
844 KB |
Output is correct |
27 |
Correct |
6 ms |
972 KB |
Output is correct |
28 |
Correct |
213 ms |
19544 KB |
Output is correct |
29 |
Correct |
373 ms |
29648 KB |
Output is correct |
30 |
Correct |
544 ms |
39288 KB |
Output is correct |
31 |
Correct |
715 ms |
49044 KB |
Output is correct |
32 |
Correct |
0 ms |
204 KB |
Output is correct |
33 |
Correct |
0 ms |
204 KB |
Output is correct |
34 |
Correct |
1 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 |
0 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 |
4 ms |
588 KB |
Output is correct |
44 |
Correct |
5 ms |
904 KB |
Output is correct |
45 |
Correct |
322 ms |
26272 KB |
Output is correct |
46 |
Correct |
524 ms |
38028 KB |
Output is correct |
47 |
Correct |
516 ms |
38020 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 |
0 ms |
204 KB |
Output is correct |
55 |
Correct |
708 ms |
46900 KB |
Output is correct |
56 |
Correct |
0 ms |
204 KB |
Output is correct |
57 |
Correct |
3 ms |
588 KB |
Output is correct |
58 |
Correct |
12 ms |
1700 KB |
Output is correct |
59 |
Correct |
16 ms |
2080 KB |
Output is correct |
60 |
Correct |
309 ms |
23336 KB |
Output is correct |
61 |
Correct |
435 ms |
31600 KB |
Output is correct |
62 |
Correct |
554 ms |
38976 KB |
Output is correct |
63 |
Correct |
681 ms |
46976 KB |
Output is correct |
64 |
Correct |
0 ms |
204 KB |
Output is correct |
65 |
Correct |
0 ms |
204 KB |
Output is correct |
66 |
Correct |
0 ms |
284 KB |
Output is correct |
67 |
Correct |
693 ms |
52300 KB |
Output is correct |
68 |
Correct |
680 ms |
53012 KB |
Output is correct |
69 |
Correct |
692 ms |
52420 KB |
Output is correct |
70 |
Correct |
7 ms |
972 KB |
Output is correct |
71 |
Correct |
15 ms |
1872 KB |
Output is correct |
72 |
Correct |
323 ms |
25600 KB |
Output is correct |
73 |
Correct |
552 ms |
38708 KB |
Output is correct |
74 |
Correct |
755 ms |
51600 KB |
Output is correct |
75 |
Correct |
718 ms |
49628 KB |
Output is correct |
76 |
Correct |
685 ms |
53036 KB |
Output is correct |
77 |
Correct |
9 ms |
1228 KB |
Output is correct |
78 |
Correct |
17 ms |
2144 KB |
Output is correct |
79 |
Correct |
319 ms |
25152 KB |
Output is correct |
80 |
Correct |
513 ms |
37640 KB |
Output is correct |
81 |
Correct |
781 ms |
50148 KB |
Output is correct |
82 |
Correct |
0 ms |
288 KB |
Output is correct |
83 |
Correct |
0 ms |
204 KB |
Output is correct |
84 |
Correct |
0 ms |
204 KB |
Output is correct |
85 |
Correct |
697 ms |
53808 KB |
Output is correct |
86 |
Correct |
750 ms |
53648 KB |
Output is correct |
87 |
Correct |
733 ms |
53908 KB |
Output is correct |
88 |
Correct |
587 ms |
45504 KB |
Output is correct |
89 |
Correct |
675 ms |
56116 KB |
Output is correct |
90 |
Correct |
746 ms |
40476 KB |
Output is correct |
91 |
Correct |
602 ms |
40432 KB |
Output is correct |
92 |
Correct |
726 ms |
52352 KB |
Output is correct |
93 |
Correct |
676 ms |
52188 KB |
Output is correct |
94 |
Correct |
813 ms |
52188 KB |
Output is correct |
95 |
Correct |
780 ms |
52388 KB |
Output is correct |
96 |
Correct |
0 ms |
204 KB |
Output is correct |
97 |
Correct |
34 ms |
4032 KB |
Output is correct |
98 |
Correct |
271 ms |
23836 KB |
Output is correct |
99 |
Correct |
722 ms |
54052 KB |
Output is correct |
100 |
Correct |
19 ms |
2252 KB |
Output is correct |
101 |
Correct |
114 ms |
9960 KB |
Output is correct |
102 |
Correct |
292 ms |
19436 KB |
Output is correct |
103 |
Correct |
245 ms |
20664 KB |
Output is correct |
104 |
Correct |
361 ms |
28148 KB |
Output is correct |
105 |
Correct |
503 ms |
35924 KB |
Output is correct |
106 |
Correct |
624 ms |
43500 KB |
Output is correct |
107 |
Correct |
781 ms |
51084 KB |
Output is correct |
108 |
Correct |
1 ms |
204 KB |
Output is correct |
109 |
Correct |
0 ms |
204 KB |
Output is correct |
110 |
Correct |
1 ms |
204 KB |
Output is correct |
111 |
Correct |
1 ms |
268 KB |
Output is correct |
112 |
Correct |
0 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 |
0 ms |
204 KB |
Output is correct |
119 |
Correct |
4 ms |
588 KB |
Output is correct |
120 |
Correct |
5 ms |
844 KB |
Output is correct |
121 |
Correct |
343 ms |
26212 KB |
Output is correct |
122 |
Correct |
531 ms |
37968 KB |
Output is correct |
123 |
Correct |
525 ms |
38108 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 |
675 ms |
52352 KB |
Output is correct |
128 |
Correct |
681 ms |
53032 KB |
Output is correct |
129 |
Correct |
676 ms |
52464 KB |
Output is correct |
130 |
Correct |
7 ms |
972 KB |
Output is correct |
131 |
Correct |
15 ms |
1920 KB |
Output is correct |
132 |
Correct |
335 ms |
25696 KB |
Output is correct |
133 |
Correct |
530 ms |
38636 KB |
Output is correct |
134 |
Correct |
747 ms |
51564 KB |
Output is correct |
135 |
Correct |
720 ms |
53500 KB |
Output is correct |
136 |
Correct |
694 ms |
53536 KB |
Output is correct |
137 |
Correct |
707 ms |
53732 KB |
Output is correct |
138 |
Correct |
694 ms |
45148 KB |
Output is correct |
139 |
Correct |
638 ms |
44264 KB |
Output is correct |
140 |
Correct |
0 ms |
204 KB |
Output is correct |
141 |
Correct |
81 ms |
8352 KB |
Output is correct |
142 |
Correct |
45 ms |
4076 KB |
Output is correct |
143 |
Correct |
185 ms |
13584 KB |
Output is correct |
144 |
Correct |
359 ms |
22104 KB |
Output is correct |
145 |
Correct |
322 ms |
24736 KB |
Output is correct |
146 |
Correct |
440 ms |
31112 KB |
Output is correct |
147 |
Correct |
530 ms |
37268 KB |
Output is correct |
148 |
Correct |
627 ms |
42876 KB |
Output is correct |
149 |
Correct |
748 ms |
49380 KB |
Output is correct |
150 |
Correct |
728 ms |
49728 KB |
Output is correct |
151 |
Correct |
684 ms |
52968 KB |
Output is correct |
152 |
Correct |
9 ms |
1228 KB |
Output is correct |
153 |
Correct |
16 ms |
2024 KB |
Output is correct |
154 |
Correct |
313 ms |
24996 KB |
Output is correct |
155 |
Correct |
527 ms |
37712 KB |
Output is correct |
156 |
Correct |
739 ms |
50176 KB |
Output is correct |
157 |
Correct |
0 ms |
284 KB |
Output is correct |
158 |
Correct |
1 ms |
204 KB |
Output is correct |
159 |
Correct |
0 ms |
284 KB |
Output is correct |
160 |
Correct |
0 ms |
204 KB |
Output is correct |
161 |
Correct |
668 ms |
43636 KB |
Output is correct |
162 |
Correct |
686 ms |
54084 KB |
Output is correct |
163 |
Correct |
685 ms |
50732 KB |
Output is correct |
164 |
Correct |
722 ms |
50752 KB |
Output is correct |
165 |
Correct |
665 ms |
46196 KB |
Output is correct |
166 |
Correct |
656 ms |
44400 KB |
Output is correct |
167 |
Correct |
123 ms |
11032 KB |
Output is correct |
168 |
Correct |
57 ms |
5260 KB |
Output is correct |
169 |
Correct |
199 ms |
13564 KB |
Output is correct |
170 |
Correct |
454 ms |
25012 KB |
Output is correct |
171 |
Correct |
609 ms |
32556 KB |
Output is correct |
172 |
Correct |
274 ms |
22524 KB |
Output is correct |
173 |
Correct |
377 ms |
26924 KB |
Output is correct |
174 |
Correct |
427 ms |
31616 KB |
Output is correct |
175 |
Correct |
504 ms |
35664 KB |
Output is correct |
176 |
Correct |
609 ms |
40452 KB |
Output is correct |
177 |
Correct |
687 ms |
44912 KB |
Output is correct |