#include "parks.h"
#include <bits/stdc++.h>
using namespace std;
void build(vector<int> u, vector<int> v, vector<int> a, vector<int> b);
struct DisjointSet{
vector<int> par;
void init(int n) {
par.resize(n);
iota(par.begin(), par.end(), 0);
}
int Find(int x) {
if (x == par[x]) return x;
return par[x] = Find(par[x]);
}
void Union(int x, int y) {
x = Find(x);
y = Find(y);
par[y] = x;
}
};
DisjointSet dsu;
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
int construct_roads(vector<int> x, vector<int> y) {
int N = x.size();
set<pair<int,int>> bench;
map<pair<int,int>,int> num;
for (int i=0; i<N; i++) {
num[{x[i], y[i]}] = i;
bench.insert({x[i]+1, y[i]+1});
bench.insert({x[i]+1, y[i]-1});
bench.insert({x[i]-1, y[i]+1});
bench.insert({x[i]-1, y[i]-1});
}
dsu.init(N);
set<pair<int,int>> ban;
vector<pair<int,int>> edge;
for (auto &[X, Y] : bench) {
if (num.find({X+1, Y+1}) == num.end()) continue;
if (num.find({X+1, Y-1}) == num.end()) continue;
if (num.find({X-1, Y+1}) == num.end()) continue;
if (num.find({X-1, Y-1}) == num.end()) continue;
int v1 = num[{X-1, Y-1}], v2 = num[{X-1, Y+1}], v3 = num[{X+1, Y+1}], v4 = num[{X+1, Y-1}];
if ((X + Y) % 4 == 0) {
if (dsu.Find(v2) != dsu.Find(v3)) {
dsu.Union(v2, v3);
edge.emplace_back(v2, v3);
}
if (dsu.Find(v3) != dsu.Find(v4)) {
dsu.Union(v3, v4);
edge.emplace_back(v3, v4);
}
ban.insert({v1, v4});
ban.insert({v4, v1});
}
else {
if (dsu.Find(v1) != dsu.Find(v2)) {
dsu.Union(v1, v2);
edge.emplace_back(v1, v2);
}
if (dsu.Find(v1) != dsu.Find(v4)) {
dsu.Union(v1, v4);
edge.emplace_back(v1, v4);
}
ban.insert({v3, v4});
ban.insert({v4, v3});
}
}
for (int i=0; i<N; i++) {
for (int k=0; k<4; k++) {
int nx = x[i] + dx[k] * 2;
int ny = y[i] + dy[k] * 2;
if (num.find({nx, ny}) == num.end()) continue;
if (dsu.Find(num[{nx, ny}]) != dsu.Find(i)) {
if (ban.find({num[{nx, ny}], i}) == ban.end()) {
dsu.Union(num[{nx, ny}], i);
edge.emplace_back(num[{nx, ny}], i);
}
}
}
}
int cnt = 0;
for (int i=0; i<N; i++) {
if (dsu.Find(i) == i) cnt ++;
}
if (cnt != 1) return 0;
vector<int> U, V, A, B;
for (auto &[u, v] : edge) {
U.push_back(u);
V.push_back(v);
if (x[u] == x[v]) {
B.push_back((y[u] + y[v]) / 2);
if ((x[u] + 1 + B.back()) % 4 == 2) A.push_back(x[u] + 1);
else A.push_back(x[u] - 1);
}
else {
A.push_back((x[u] + x[v]) / 2);
if ((y[u] + 1 + A.back()) % 4 == 0) B.push_back(y[u] + 1);
else B.push_back(y[u] - 1);
}
}
build(U, V, A, B);
return 1;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 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 |
1 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
436 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
282 ms |
24992 KB |
Output is correct |
10 |
Correct |
15 ms |
2904 KB |
Output is correct |
11 |
Correct |
99 ms |
13804 KB |
Output is correct |
12 |
Correct |
24 ms |
4060 KB |
Output is correct |
13 |
Correct |
66 ms |
9168 KB |
Output is correct |
14 |
Correct |
2 ms |
628 KB |
Output is correct |
15 |
Correct |
3 ms |
604 KB |
Output is correct |
16 |
Correct |
273 ms |
25172 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 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 |
1 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
436 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
282 ms |
24992 KB |
Output is correct |
10 |
Correct |
15 ms |
2904 KB |
Output is correct |
11 |
Correct |
99 ms |
13804 KB |
Output is correct |
12 |
Correct |
24 ms |
4060 KB |
Output is correct |
13 |
Correct |
66 ms |
9168 KB |
Output is correct |
14 |
Correct |
2 ms |
628 KB |
Output is correct |
15 |
Correct |
3 ms |
604 KB |
Output is correct |
16 |
Correct |
273 ms |
25172 KB |
Output is correct |
17 |
Correct |
1 ms |
344 KB |
Output is correct |
18 |
Correct |
1 ms |
348 KB |
Output is correct |
19 |
Correct |
0 ms |
348 KB |
Output is correct |
20 |
Correct |
0 ms |
348 KB |
Output is correct |
21 |
Correct |
0 ms |
348 KB |
Output is correct |
22 |
Correct |
0 ms |
348 KB |
Output is correct |
23 |
Correct |
937 ms |
54772 KB |
Output is correct |
24 |
Correct |
1 ms |
344 KB |
Output is correct |
25 |
Correct |
3 ms |
600 KB |
Output is correct |
26 |
Correct |
6 ms |
856 KB |
Output is correct |
27 |
Correct |
8 ms |
1116 KB |
Output is correct |
28 |
Correct |
286 ms |
22228 KB |
Output is correct |
29 |
Correct |
517 ms |
32612 KB |
Output is correct |
30 |
Correct |
801 ms |
44536 KB |
Output is correct |
31 |
Correct |
1041 ms |
54760 KB |
Output is correct |
32 |
Correct |
0 ms |
348 KB |
Output is correct |
33 |
Correct |
0 ms |
348 KB |
Output is correct |
34 |
Correct |
1 ms |
348 KB |
Output is correct |
35 |
Correct |
0 ms |
348 KB |
Output is correct |
36 |
Correct |
1 ms |
348 KB |
Output is correct |
37 |
Correct |
0 ms |
344 KB |
Output is correct |
38 |
Correct |
0 ms |
348 KB |
Output is correct |
39 |
Correct |
1 ms |
348 KB |
Output is correct |
40 |
Correct |
0 ms |
348 KB |
Output is correct |
41 |
Correct |
1 ms |
344 KB |
Output is correct |
42 |
Correct |
1 ms |
348 KB |
Output is correct |
43 |
Correct |
5 ms |
600 KB |
Output is correct |
44 |
Correct |
5 ms |
860 KB |
Output is correct |
45 |
Correct |
332 ms |
25160 KB |
Output is correct |
46 |
Correct |
603 ms |
36892 KB |
Output is correct |
47 |
Correct |
617 ms |
37156 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 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 |
1 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
436 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
282 ms |
24992 KB |
Output is correct |
10 |
Correct |
15 ms |
2904 KB |
Output is correct |
11 |
Correct |
99 ms |
13804 KB |
Output is correct |
12 |
Correct |
24 ms |
4060 KB |
Output is correct |
13 |
Correct |
66 ms |
9168 KB |
Output is correct |
14 |
Correct |
2 ms |
628 KB |
Output is correct |
15 |
Correct |
3 ms |
604 KB |
Output is correct |
16 |
Correct |
273 ms |
25172 KB |
Output is correct |
17 |
Correct |
1 ms |
344 KB |
Output is correct |
18 |
Correct |
1 ms |
348 KB |
Output is correct |
19 |
Correct |
0 ms |
348 KB |
Output is correct |
20 |
Correct |
0 ms |
348 KB |
Output is correct |
21 |
Correct |
0 ms |
348 KB |
Output is correct |
22 |
Correct |
0 ms |
348 KB |
Output is correct |
23 |
Correct |
937 ms |
54772 KB |
Output is correct |
24 |
Correct |
1 ms |
344 KB |
Output is correct |
25 |
Correct |
3 ms |
600 KB |
Output is correct |
26 |
Correct |
6 ms |
856 KB |
Output is correct |
27 |
Correct |
8 ms |
1116 KB |
Output is correct |
28 |
Correct |
286 ms |
22228 KB |
Output is correct |
29 |
Correct |
517 ms |
32612 KB |
Output is correct |
30 |
Correct |
801 ms |
44536 KB |
Output is correct |
31 |
Correct |
1041 ms |
54760 KB |
Output is correct |
32 |
Correct |
0 ms |
348 KB |
Output is correct |
33 |
Correct |
0 ms |
348 KB |
Output is correct |
34 |
Correct |
1 ms |
348 KB |
Output is correct |
35 |
Correct |
0 ms |
348 KB |
Output is correct |
36 |
Correct |
1 ms |
348 KB |
Output is correct |
37 |
Correct |
0 ms |
344 KB |
Output is correct |
38 |
Correct |
0 ms |
348 KB |
Output is correct |
39 |
Correct |
1 ms |
348 KB |
Output is correct |
40 |
Correct |
0 ms |
348 KB |
Output is correct |
41 |
Correct |
1 ms |
344 KB |
Output is correct |
42 |
Correct |
1 ms |
348 KB |
Output is correct |
43 |
Correct |
5 ms |
600 KB |
Output is correct |
44 |
Correct |
5 ms |
860 KB |
Output is correct |
45 |
Correct |
332 ms |
25160 KB |
Output is correct |
46 |
Correct |
603 ms |
36892 KB |
Output is correct |
47 |
Correct |
617 ms |
37156 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 |
1 ms |
348 KB |
Output is correct |
52 |
Correct |
0 ms |
348 KB |
Output is correct |
53 |
Correct |
1 ms |
348 KB |
Output is correct |
54 |
Correct |
1 ms |
348 KB |
Output is correct |
55 |
Correct |
1092 ms |
56236 KB |
Output is correct |
56 |
Correct |
0 ms |
344 KB |
Output is correct |
57 |
Correct |
5 ms |
860 KB |
Output is correct |
58 |
Correct |
15 ms |
2140 KB |
Output is correct |
59 |
Correct |
24 ms |
2628 KB |
Output is correct |
60 |
Correct |
425 ms |
28072 KB |
Output is correct |
61 |
Correct |
658 ms |
38880 KB |
Output is correct |
62 |
Correct |
759 ms |
47260 KB |
Output is correct |
63 |
Correct |
1014 ms |
56352 KB |
Output is correct |
64 |
Correct |
1 ms |
344 KB |
Output is correct |
65 |
Correct |
0 ms |
348 KB |
Output is correct |
66 |
Correct |
0 ms |
348 KB |
Output is correct |
67 |
Correct |
624 ms |
50048 KB |
Output is correct |
68 |
Correct |
672 ms |
50056 KB |
Output is correct |
69 |
Correct |
613 ms |
49812 KB |
Output is correct |
70 |
Correct |
7 ms |
1116 KB |
Output is correct |
71 |
Correct |
16 ms |
1760 KB |
Output is correct |
72 |
Correct |
306 ms |
24456 KB |
Output is correct |
73 |
Correct |
517 ms |
37520 KB |
Output is correct |
74 |
Correct |
765 ms |
49024 KB |
Output is correct |
75 |
Correct |
724 ms |
46204 KB |
Output is correct |
76 |
Correct |
650 ms |
50064 KB |
Output is correct |
77 |
Correct |
9 ms |
1368 KB |
Output is correct |
78 |
Correct |
18 ms |
2140 KB |
Output is correct |
79 |
Correct |
307 ms |
23972 KB |
Output is correct |
80 |
Correct |
533 ms |
36616 KB |
Output is correct |
81 |
Correct |
797 ms |
47676 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 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 |
1 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
436 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
282 ms |
24992 KB |
Output is correct |
10 |
Correct |
15 ms |
2904 KB |
Output is correct |
11 |
Correct |
99 ms |
13804 KB |
Output is correct |
12 |
Correct |
24 ms |
4060 KB |
Output is correct |
13 |
Correct |
66 ms |
9168 KB |
Output is correct |
14 |
Correct |
2 ms |
628 KB |
Output is correct |
15 |
Correct |
3 ms |
604 KB |
Output is correct |
16 |
Correct |
273 ms |
25172 KB |
Output is correct |
17 |
Correct |
1 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 |
730 ms |
51888 KB |
Output is correct |
21 |
Correct |
696 ms |
51400 KB |
Output is correct |
22 |
Correct |
745 ms |
51592 KB |
Output is correct |
23 |
Correct |
533 ms |
43720 KB |
Output is correct |
24 |
Correct |
671 ms |
56140 KB |
Output is correct |
25 |
Correct |
745 ms |
39488 KB |
Output is correct |
26 |
Correct |
689 ms |
39368 KB |
Output is correct |
27 |
Correct |
745 ms |
49852 KB |
Output is correct |
28 |
Correct |
738 ms |
49876 KB |
Output is correct |
29 |
Correct |
841 ms |
50048 KB |
Output is correct |
30 |
Correct |
863 ms |
50068 KB |
Output is correct |
31 |
Correct |
1 ms |
348 KB |
Output is correct |
32 |
Correct |
37 ms |
3912 KB |
Output is correct |
33 |
Correct |
215 ms |
23864 KB |
Output is correct |
34 |
Correct |
675 ms |
51844 KB |
Output is correct |
35 |
Correct |
21 ms |
2392 KB |
Output is correct |
36 |
Correct |
138 ms |
9592 KB |
Output is correct |
37 |
Correct |
315 ms |
18876 KB |
Output is correct |
38 |
Correct |
268 ms |
20056 KB |
Output is correct |
39 |
Correct |
383 ms |
26636 KB |
Output is correct |
40 |
Correct |
528 ms |
35028 KB |
Output is correct |
41 |
Correct |
652 ms |
41560 KB |
Output is correct |
42 |
Correct |
881 ms |
49180 KB |
Output is correct |
43 |
Correct |
1 ms |
348 KB |
Output is correct |
44 |
Correct |
0 ms |
348 KB |
Output is correct |
45 |
Correct |
1 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 |
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 |
3 ms |
604 KB |
Output is correct |
55 |
Correct |
5 ms |
856 KB |
Output is correct |
56 |
Correct |
322 ms |
25044 KB |
Output is correct |
57 |
Correct |
490 ms |
37084 KB |
Output is correct |
58 |
Correct |
480 ms |
37088 KB |
Output is correct |
59 |
Correct |
1 ms |
344 KB |
Output is correct |
60 |
Correct |
0 ms |
348 KB |
Output is correct |
61 |
Correct |
0 ms |
344 KB |
Output is correct |
62 |
Correct |
651 ms |
50028 KB |
Output is correct |
63 |
Correct |
696 ms |
50048 KB |
Output is correct |
64 |
Correct |
639 ms |
49724 KB |
Output is correct |
65 |
Correct |
7 ms |
1116 KB |
Output is correct |
66 |
Correct |
16 ms |
1884 KB |
Output is correct |
67 |
Correct |
348 ms |
24364 KB |
Output is correct |
68 |
Correct |
549 ms |
37520 KB |
Output is correct |
69 |
Correct |
770 ms |
49024 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 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 |
1 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
436 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
282 ms |
24992 KB |
Output is correct |
10 |
Correct |
15 ms |
2904 KB |
Output is correct |
11 |
Correct |
99 ms |
13804 KB |
Output is correct |
12 |
Correct |
24 ms |
4060 KB |
Output is correct |
13 |
Correct |
66 ms |
9168 KB |
Output is correct |
14 |
Correct |
2 ms |
628 KB |
Output is correct |
15 |
Correct |
3 ms |
604 KB |
Output is correct |
16 |
Correct |
273 ms |
25172 KB |
Output is correct |
17 |
Correct |
685 ms |
50820 KB |
Output is correct |
18 |
Correct |
723 ms |
51500 KB |
Output is correct |
19 |
Correct |
708 ms |
51076 KB |
Output is correct |
20 |
Correct |
824 ms |
42788 KB |
Output is correct |
21 |
Correct |
711 ms |
42588 KB |
Output is correct |
22 |
Correct |
0 ms |
348 KB |
Output is correct |
23 |
Correct |
87 ms |
8036 KB |
Output is correct |
24 |
Correct |
51 ms |
3924 KB |
Output is correct |
25 |
Correct |
221 ms |
13012 KB |
Output is correct |
26 |
Correct |
406 ms |
21412 KB |
Output is correct |
27 |
Correct |
340 ms |
23628 KB |
Output is correct |
28 |
Correct |
470 ms |
29356 KB |
Output is correct |
29 |
Correct |
576 ms |
36248 KB |
Output is correct |
30 |
Correct |
738 ms |
41224 KB |
Output is correct |
31 |
Correct |
808 ms |
46976 KB |
Output is correct |
32 |
Correct |
750 ms |
46176 KB |
Output is correct |
33 |
Correct |
689 ms |
50052 KB |
Output is correct |
34 |
Correct |
10 ms |
1372 KB |
Output is correct |
35 |
Correct |
18 ms |
2156 KB |
Output is correct |
36 |
Correct |
357 ms |
23964 KB |
Output is correct |
37 |
Correct |
623 ms |
36752 KB |
Output is correct |
38 |
Correct |
958 ms |
47652 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 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 |
1 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
436 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
282 ms |
24992 KB |
Output is correct |
10 |
Correct |
15 ms |
2904 KB |
Output is correct |
11 |
Correct |
99 ms |
13804 KB |
Output is correct |
12 |
Correct |
24 ms |
4060 KB |
Output is correct |
13 |
Correct |
66 ms |
9168 KB |
Output is correct |
14 |
Correct |
2 ms |
628 KB |
Output is correct |
15 |
Correct |
3 ms |
604 KB |
Output is correct |
16 |
Correct |
273 ms |
25172 KB |
Output is correct |
17 |
Correct |
1 ms |
344 KB |
Output is correct |
18 |
Correct |
1 ms |
348 KB |
Output is correct |
19 |
Correct |
0 ms |
348 KB |
Output is correct |
20 |
Correct |
0 ms |
348 KB |
Output is correct |
21 |
Correct |
0 ms |
348 KB |
Output is correct |
22 |
Correct |
0 ms |
348 KB |
Output is correct |
23 |
Correct |
937 ms |
54772 KB |
Output is correct |
24 |
Correct |
1 ms |
344 KB |
Output is correct |
25 |
Correct |
3 ms |
600 KB |
Output is correct |
26 |
Correct |
6 ms |
856 KB |
Output is correct |
27 |
Correct |
8 ms |
1116 KB |
Output is correct |
28 |
Correct |
286 ms |
22228 KB |
Output is correct |
29 |
Correct |
517 ms |
32612 KB |
Output is correct |
30 |
Correct |
801 ms |
44536 KB |
Output is correct |
31 |
Correct |
1041 ms |
54760 KB |
Output is correct |
32 |
Correct |
0 ms |
348 KB |
Output is correct |
33 |
Correct |
0 ms |
348 KB |
Output is correct |
34 |
Correct |
1 ms |
348 KB |
Output is correct |
35 |
Correct |
0 ms |
348 KB |
Output is correct |
36 |
Correct |
1 ms |
348 KB |
Output is correct |
37 |
Correct |
0 ms |
344 KB |
Output is correct |
38 |
Correct |
0 ms |
348 KB |
Output is correct |
39 |
Correct |
1 ms |
348 KB |
Output is correct |
40 |
Correct |
0 ms |
348 KB |
Output is correct |
41 |
Correct |
1 ms |
344 KB |
Output is correct |
42 |
Correct |
1 ms |
348 KB |
Output is correct |
43 |
Correct |
5 ms |
600 KB |
Output is correct |
44 |
Correct |
5 ms |
860 KB |
Output is correct |
45 |
Correct |
332 ms |
25160 KB |
Output is correct |
46 |
Correct |
603 ms |
36892 KB |
Output is correct |
47 |
Correct |
617 ms |
37156 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 |
1 ms |
348 KB |
Output is correct |
52 |
Correct |
0 ms |
348 KB |
Output is correct |
53 |
Correct |
1 ms |
348 KB |
Output is correct |
54 |
Correct |
1 ms |
348 KB |
Output is correct |
55 |
Correct |
1092 ms |
56236 KB |
Output is correct |
56 |
Correct |
0 ms |
344 KB |
Output is correct |
57 |
Correct |
5 ms |
860 KB |
Output is correct |
58 |
Correct |
15 ms |
2140 KB |
Output is correct |
59 |
Correct |
24 ms |
2628 KB |
Output is correct |
60 |
Correct |
425 ms |
28072 KB |
Output is correct |
61 |
Correct |
658 ms |
38880 KB |
Output is correct |
62 |
Correct |
759 ms |
47260 KB |
Output is correct |
63 |
Correct |
1014 ms |
56352 KB |
Output is correct |
64 |
Correct |
1 ms |
344 KB |
Output is correct |
65 |
Correct |
0 ms |
348 KB |
Output is correct |
66 |
Correct |
0 ms |
348 KB |
Output is correct |
67 |
Correct |
624 ms |
50048 KB |
Output is correct |
68 |
Correct |
672 ms |
50056 KB |
Output is correct |
69 |
Correct |
613 ms |
49812 KB |
Output is correct |
70 |
Correct |
7 ms |
1116 KB |
Output is correct |
71 |
Correct |
16 ms |
1760 KB |
Output is correct |
72 |
Correct |
306 ms |
24456 KB |
Output is correct |
73 |
Correct |
517 ms |
37520 KB |
Output is correct |
74 |
Correct |
765 ms |
49024 KB |
Output is correct |
75 |
Correct |
724 ms |
46204 KB |
Output is correct |
76 |
Correct |
650 ms |
50064 KB |
Output is correct |
77 |
Correct |
9 ms |
1368 KB |
Output is correct |
78 |
Correct |
18 ms |
2140 KB |
Output is correct |
79 |
Correct |
307 ms |
23972 KB |
Output is correct |
80 |
Correct |
533 ms |
36616 KB |
Output is correct |
81 |
Correct |
797 ms |
47676 KB |
Output is correct |
82 |
Correct |
1 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 |
730 ms |
51888 KB |
Output is correct |
86 |
Correct |
696 ms |
51400 KB |
Output is correct |
87 |
Correct |
745 ms |
51592 KB |
Output is correct |
88 |
Correct |
533 ms |
43720 KB |
Output is correct |
89 |
Correct |
671 ms |
56140 KB |
Output is correct |
90 |
Correct |
745 ms |
39488 KB |
Output is correct |
91 |
Correct |
689 ms |
39368 KB |
Output is correct |
92 |
Correct |
745 ms |
49852 KB |
Output is correct |
93 |
Correct |
738 ms |
49876 KB |
Output is correct |
94 |
Correct |
841 ms |
50048 KB |
Output is correct |
95 |
Correct |
863 ms |
50068 KB |
Output is correct |
96 |
Correct |
1 ms |
348 KB |
Output is correct |
97 |
Correct |
37 ms |
3912 KB |
Output is correct |
98 |
Correct |
215 ms |
23864 KB |
Output is correct |
99 |
Correct |
675 ms |
51844 KB |
Output is correct |
100 |
Correct |
21 ms |
2392 KB |
Output is correct |
101 |
Correct |
138 ms |
9592 KB |
Output is correct |
102 |
Correct |
315 ms |
18876 KB |
Output is correct |
103 |
Correct |
268 ms |
20056 KB |
Output is correct |
104 |
Correct |
383 ms |
26636 KB |
Output is correct |
105 |
Correct |
528 ms |
35028 KB |
Output is correct |
106 |
Correct |
652 ms |
41560 KB |
Output is correct |
107 |
Correct |
881 ms |
49180 KB |
Output is correct |
108 |
Correct |
1 ms |
348 KB |
Output is correct |
109 |
Correct |
0 ms |
348 KB |
Output is correct |
110 |
Correct |
1 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 |
0 ms |
348 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 |
604 KB |
Output is correct |
120 |
Correct |
5 ms |
856 KB |
Output is correct |
121 |
Correct |
322 ms |
25044 KB |
Output is correct |
122 |
Correct |
490 ms |
37084 KB |
Output is correct |
123 |
Correct |
480 ms |
37088 KB |
Output is correct |
124 |
Correct |
1 ms |
344 KB |
Output is correct |
125 |
Correct |
0 ms |
348 KB |
Output is correct |
126 |
Correct |
0 ms |
344 KB |
Output is correct |
127 |
Correct |
651 ms |
50028 KB |
Output is correct |
128 |
Correct |
696 ms |
50048 KB |
Output is correct |
129 |
Correct |
639 ms |
49724 KB |
Output is correct |
130 |
Correct |
7 ms |
1116 KB |
Output is correct |
131 |
Correct |
16 ms |
1884 KB |
Output is correct |
132 |
Correct |
348 ms |
24364 KB |
Output is correct |
133 |
Correct |
549 ms |
37520 KB |
Output is correct |
134 |
Correct |
770 ms |
49024 KB |
Output is correct |
135 |
Correct |
685 ms |
50820 KB |
Output is correct |
136 |
Correct |
723 ms |
51500 KB |
Output is correct |
137 |
Correct |
708 ms |
51076 KB |
Output is correct |
138 |
Correct |
824 ms |
42788 KB |
Output is correct |
139 |
Correct |
711 ms |
42588 KB |
Output is correct |
140 |
Correct |
0 ms |
348 KB |
Output is correct |
141 |
Correct |
87 ms |
8036 KB |
Output is correct |
142 |
Correct |
51 ms |
3924 KB |
Output is correct |
143 |
Correct |
221 ms |
13012 KB |
Output is correct |
144 |
Correct |
406 ms |
21412 KB |
Output is correct |
145 |
Correct |
340 ms |
23628 KB |
Output is correct |
146 |
Correct |
470 ms |
29356 KB |
Output is correct |
147 |
Correct |
576 ms |
36248 KB |
Output is correct |
148 |
Correct |
738 ms |
41224 KB |
Output is correct |
149 |
Correct |
808 ms |
46976 KB |
Output is correct |
150 |
Correct |
750 ms |
46176 KB |
Output is correct |
151 |
Correct |
689 ms |
50052 KB |
Output is correct |
152 |
Correct |
10 ms |
1372 KB |
Output is correct |
153 |
Correct |
18 ms |
2156 KB |
Output is correct |
154 |
Correct |
357 ms |
23964 KB |
Output is correct |
155 |
Correct |
623 ms |
36752 KB |
Output is correct |
156 |
Correct |
958 ms |
47652 KB |
Output is correct |
157 |
Correct |
0 ms |
348 KB |
Output is correct |
158 |
Correct |
0 ms |
348 KB |
Output is correct |
159 |
Correct |
1 ms |
348 KB |
Output is correct |
160 |
Correct |
0 ms |
348 KB |
Output is correct |
161 |
Correct |
1189 ms |
59520 KB |
Output is correct |
162 |
Correct |
719 ms |
51960 KB |
Output is correct |
163 |
Correct |
863 ms |
54840 KB |
Output is correct |
164 |
Correct |
756 ms |
54788 KB |
Output is correct |
165 |
Correct |
1087 ms |
58580 KB |
Output is correct |
166 |
Correct |
1098 ms |
59784 KB |
Output is correct |
167 |
Correct |
179 ms |
13680 KB |
Output is correct |
168 |
Correct |
103 ms |
7408 KB |
Output is correct |
169 |
Correct |
358 ms |
19396 KB |
Output is correct |
170 |
Correct |
747 ms |
36288 KB |
Output is correct |
171 |
Correct |
1082 ms |
47812 KB |
Output is correct |
172 |
Correct |
450 ms |
30460 KB |
Output is correct |
173 |
Correct |
571 ms |
36200 KB |
Output is correct |
174 |
Correct |
702 ms |
43684 KB |
Output is correct |
175 |
Correct |
906 ms |
49132 KB |
Output is correct |
176 |
Correct |
1082 ms |
55328 KB |
Output is correct |
177 |
Correct |
1278 ms |
60916 KB |
Output is correct |