#include "parks.h"
#include <algorithm>
#include <queue>
#include <vector>
const int kMax = 200005;
std::vector<std::pair<int, int>> fountains[kMax];
bool isConnected(std::vector<std::vector<int>> adj) {
int n = adj.size();
std::vector<bool> vis(n);
std::queue<int> q;
q.push(0); vis[0] = true;
while (!q.empty()) {
int u = q.front();
q.pop();
for (int v : adj[u]) {
if (vis[v]) continue;
vis[v] = true;
q.push(v);
}
}
return all_of(vis.begin(), vis.end(), [](bool visited) { return visited; });
}
int construct_roads(std::vector<int> x, std::vector<int> y) {
int n = x.size();
for (int i = 0; i < n; ++i) {
fountains[x[i]].emplace_back(y[i], i);
}
for (int i = 0; i < kMax; ++i) {
std::sort(fountains[i].begin(), fountains[i].end());
}
std::vector<std::tuple<int, int, int, int, int>> pathways;
std::vector<std::vector<int>> adj(n);
for (int i = 0; i < n; ++i) {
auto it = std::lower_bound(fountains[x[i] + 2].begin(), fountains[x[i] + 2].end(),
std::make_pair(y[i], -1));
if (it != fountains[x[i] + 2].end() && it->first == y[i]) {
int ny = x[i] + y[i] & 2 ? y[i] + 1 : y[i] - 1;
pathways.emplace_back(x[i] + 1, ny, x[i] + y[i], i, it->second);
adj[i].emplace_back(it->second);
adj[it->second].emplace_back(i);
}
it = std::lower_bound(fountains[x[i]].begin(), fountains[x[i]].end(),
std::make_pair(y[i] + 2, -1));
if (it != fountains[x[i]].end() && it->first == y[i] + 2) {
int nx = x[i] + y[i] & 2 ? x[i] - 1 : x[i] + 1;
pathways.emplace_back(nx, y[i] + 1, x[i] + y[i], i, it->second);
adj[i].emplace_back(it->second);
adj[it->second].emplace_back(i);
}
}
if (!isConnected(adj)) return 0;
std::sort(pathways.begin(), pathways.end());
std::vector<int> u, v, a, b;
for (int i = 0; i < static_cast<int>(pathways.size()); ++i) {
if (i > 0 && std::get<0>(pathways[i]) == std::get<0>(pathways[i - 1]) &&
std::get<1>(pathways[i]) == std::get<1>(pathways[i - 1])) {
continue;
}
u.emplace_back(std::get<3>(pathways[i]));
v.emplace_back(std::get<4>(pathways[i]));
a.emplace_back(std::get<0>(pathways[i]));
b.emplace_back(std::get<1>(pathways[i]));
}
build(u, v, a, b);
return 1;
}
Compilation message
parks.cpp: In function 'int construct_roads(std::vector<int>, std::vector<int>)':
parks.cpp:46:21: warning: suggest parentheses around '+' in operand of '&' [-Wparentheses]
46 | int ny = x[i] + y[i] & 2 ? y[i] + 1 : y[i] - 1;
parks.cpp:54:21: warning: suggest parentheses around '+' in operand of '&' [-Wparentheses]
54 | int nx = x[i] + y[i] & 2 ? x[i] - 1 : x[i] + 1;
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
4940 KB |
Output is correct |
2 |
Correct |
5 ms |
4940 KB |
Output is correct |
3 |
Correct |
4 ms |
4940 KB |
Output is correct |
4 |
Correct |
5 ms |
4940 KB |
Output is correct |
5 |
Correct |
4 ms |
4940 KB |
Output is correct |
6 |
Correct |
5 ms |
4940 KB |
Output is correct |
7 |
Correct |
5 ms |
4940 KB |
Output is correct |
8 |
Correct |
4 ms |
4940 KB |
Output is correct |
9 |
Correct |
156 ms |
20204 KB |
Output is correct |
10 |
Correct |
13 ms |
6460 KB |
Output is correct |
11 |
Correct |
64 ms |
13144 KB |
Output is correct |
12 |
Correct |
18 ms |
7208 KB |
Output is correct |
13 |
Correct |
28 ms |
11652 KB |
Output is correct |
14 |
Correct |
6 ms |
5004 KB |
Output is correct |
15 |
Correct |
5 ms |
5196 KB |
Output is correct |
16 |
Correct |
158 ms |
20236 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
4940 KB |
Output is correct |
2 |
Correct |
5 ms |
4940 KB |
Output is correct |
3 |
Correct |
4 ms |
4940 KB |
Output is correct |
4 |
Correct |
5 ms |
4940 KB |
Output is correct |
5 |
Correct |
4 ms |
4940 KB |
Output is correct |
6 |
Correct |
5 ms |
4940 KB |
Output is correct |
7 |
Correct |
5 ms |
4940 KB |
Output is correct |
8 |
Correct |
4 ms |
4940 KB |
Output is correct |
9 |
Correct |
156 ms |
20204 KB |
Output is correct |
10 |
Correct |
13 ms |
6460 KB |
Output is correct |
11 |
Correct |
64 ms |
13144 KB |
Output is correct |
12 |
Correct |
18 ms |
7208 KB |
Output is correct |
13 |
Correct |
28 ms |
11652 KB |
Output is correct |
14 |
Correct |
6 ms |
5004 KB |
Output is correct |
15 |
Correct |
5 ms |
5196 KB |
Output is correct |
16 |
Correct |
158 ms |
20236 KB |
Output is correct |
17 |
Correct |
4 ms |
4940 KB |
Output is correct |
18 |
Correct |
8 ms |
4940 KB |
Output is correct |
19 |
Correct |
4 ms |
4940 KB |
Output is correct |
20 |
Correct |
5 ms |
4940 KB |
Output is correct |
21 |
Correct |
5 ms |
4912 KB |
Output is correct |
22 |
Correct |
5 ms |
4888 KB |
Output is correct |
23 |
Correct |
480 ms |
37880 KB |
Output is correct |
24 |
Correct |
0 ms |
4940 KB |
Output is correct |
25 |
Correct |
7 ms |
5196 KB |
Output is correct |
26 |
Correct |
6 ms |
5452 KB |
Output is correct |
27 |
Correct |
9 ms |
5580 KB |
Output is correct |
28 |
Correct |
148 ms |
18244 KB |
Output is correct |
29 |
Correct |
231 ms |
24488 KB |
Output is correct |
30 |
Correct |
346 ms |
31592 KB |
Output is correct |
31 |
Correct |
505 ms |
37908 KB |
Output is correct |
32 |
Correct |
4 ms |
4940 KB |
Output is correct |
33 |
Correct |
4 ms |
4940 KB |
Output is correct |
34 |
Correct |
17 ms |
4940 KB |
Output is correct |
35 |
Correct |
5 ms |
4940 KB |
Output is correct |
36 |
Correct |
4 ms |
4940 KB |
Output is correct |
37 |
Correct |
5 ms |
4940 KB |
Output is correct |
38 |
Correct |
4 ms |
4940 KB |
Output is correct |
39 |
Correct |
5 ms |
4940 KB |
Output is correct |
40 |
Correct |
5 ms |
4940 KB |
Output is correct |
41 |
Correct |
4 ms |
4940 KB |
Output is correct |
42 |
Correct |
4 ms |
4940 KB |
Output is correct |
43 |
Correct |
5 ms |
5196 KB |
Output is correct |
44 |
Correct |
8 ms |
5436 KB |
Output is correct |
45 |
Correct |
188 ms |
20172 KB |
Output is correct |
46 |
Correct |
265 ms |
28288 KB |
Output is correct |
47 |
Correct |
342 ms |
28260 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
4940 KB |
Output is correct |
2 |
Correct |
5 ms |
4940 KB |
Output is correct |
3 |
Correct |
4 ms |
4940 KB |
Output is correct |
4 |
Correct |
5 ms |
4940 KB |
Output is correct |
5 |
Correct |
4 ms |
4940 KB |
Output is correct |
6 |
Correct |
5 ms |
4940 KB |
Output is correct |
7 |
Correct |
5 ms |
4940 KB |
Output is correct |
8 |
Correct |
4 ms |
4940 KB |
Output is correct |
9 |
Correct |
156 ms |
20204 KB |
Output is correct |
10 |
Correct |
13 ms |
6460 KB |
Output is correct |
11 |
Correct |
64 ms |
13144 KB |
Output is correct |
12 |
Correct |
18 ms |
7208 KB |
Output is correct |
13 |
Correct |
28 ms |
11652 KB |
Output is correct |
14 |
Correct |
6 ms |
5004 KB |
Output is correct |
15 |
Correct |
5 ms |
5196 KB |
Output is correct |
16 |
Correct |
158 ms |
20236 KB |
Output is correct |
17 |
Correct |
4 ms |
4940 KB |
Output is correct |
18 |
Correct |
8 ms |
4940 KB |
Output is correct |
19 |
Correct |
4 ms |
4940 KB |
Output is correct |
20 |
Correct |
5 ms |
4940 KB |
Output is correct |
21 |
Correct |
5 ms |
4912 KB |
Output is correct |
22 |
Correct |
5 ms |
4888 KB |
Output is correct |
23 |
Correct |
480 ms |
37880 KB |
Output is correct |
24 |
Correct |
0 ms |
4940 KB |
Output is correct |
25 |
Correct |
7 ms |
5196 KB |
Output is correct |
26 |
Correct |
6 ms |
5452 KB |
Output is correct |
27 |
Correct |
9 ms |
5580 KB |
Output is correct |
28 |
Correct |
148 ms |
18244 KB |
Output is correct |
29 |
Correct |
231 ms |
24488 KB |
Output is correct |
30 |
Correct |
346 ms |
31592 KB |
Output is correct |
31 |
Correct |
505 ms |
37908 KB |
Output is correct |
32 |
Correct |
4 ms |
4940 KB |
Output is correct |
33 |
Correct |
4 ms |
4940 KB |
Output is correct |
34 |
Correct |
17 ms |
4940 KB |
Output is correct |
35 |
Correct |
5 ms |
4940 KB |
Output is correct |
36 |
Correct |
4 ms |
4940 KB |
Output is correct |
37 |
Correct |
5 ms |
4940 KB |
Output is correct |
38 |
Correct |
4 ms |
4940 KB |
Output is correct |
39 |
Correct |
5 ms |
4940 KB |
Output is correct |
40 |
Correct |
5 ms |
4940 KB |
Output is correct |
41 |
Correct |
4 ms |
4940 KB |
Output is correct |
42 |
Correct |
4 ms |
4940 KB |
Output is correct |
43 |
Correct |
5 ms |
5196 KB |
Output is correct |
44 |
Correct |
8 ms |
5436 KB |
Output is correct |
45 |
Correct |
188 ms |
20172 KB |
Output is correct |
46 |
Correct |
265 ms |
28288 KB |
Output is correct |
47 |
Correct |
342 ms |
28260 KB |
Output is correct |
48 |
Correct |
7 ms |
4940 KB |
Output is correct |
49 |
Correct |
6 ms |
4940 KB |
Output is correct |
50 |
Correct |
4 ms |
4940 KB |
Output is correct |
51 |
Correct |
5 ms |
4980 KB |
Output is correct |
52 |
Correct |
6 ms |
4940 KB |
Output is correct |
53 |
Correct |
6 ms |
4940 KB |
Output is correct |
54 |
Correct |
5 ms |
4940 KB |
Output is correct |
55 |
Correct |
514 ms |
38512 KB |
Output is correct |
56 |
Correct |
4 ms |
4940 KB |
Output is correct |
57 |
Correct |
6 ms |
5324 KB |
Output is correct |
58 |
Correct |
13 ms |
5988 KB |
Output is correct |
59 |
Correct |
16 ms |
6552 KB |
Output is correct |
60 |
Correct |
212 ms |
21696 KB |
Output is correct |
61 |
Correct |
303 ms |
28336 KB |
Output is correct |
62 |
Correct |
519 ms |
33388 KB |
Output is correct |
63 |
Correct |
504 ms |
38544 KB |
Output is correct |
64 |
Correct |
4 ms |
4940 KB |
Output is correct |
65 |
Correct |
5 ms |
4940 KB |
Output is correct |
66 |
Correct |
4 ms |
4940 KB |
Output is correct |
67 |
Correct |
396 ms |
35528 KB |
Output is correct |
68 |
Correct |
413 ms |
35528 KB |
Output is correct |
69 |
Correct |
447 ms |
35396 KB |
Output is correct |
70 |
Correct |
9 ms |
5580 KB |
Output is correct |
71 |
Correct |
15 ms |
6188 KB |
Output is correct |
72 |
Correct |
244 ms |
20244 KB |
Output is correct |
73 |
Correct |
340 ms |
28476 KB |
Output is correct |
74 |
Correct |
582 ms |
35488 KB |
Output is correct |
75 |
Correct |
529 ms |
37248 KB |
Output is correct |
76 |
Correct |
516 ms |
35544 KB |
Output is correct |
77 |
Correct |
10 ms |
5708 KB |
Output is correct |
78 |
Correct |
15 ms |
6356 KB |
Output is correct |
79 |
Correct |
237 ms |
20648 KB |
Output is correct |
80 |
Correct |
286 ms |
29820 KB |
Output is correct |
81 |
Correct |
509 ms |
36432 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
4940 KB |
Output is correct |
2 |
Correct |
5 ms |
4940 KB |
Output is correct |
3 |
Correct |
4 ms |
4940 KB |
Output is correct |
4 |
Correct |
5 ms |
4940 KB |
Output is correct |
5 |
Correct |
4 ms |
4940 KB |
Output is correct |
6 |
Correct |
5 ms |
4940 KB |
Output is correct |
7 |
Correct |
5 ms |
4940 KB |
Output is correct |
8 |
Correct |
4 ms |
4940 KB |
Output is correct |
9 |
Correct |
156 ms |
20204 KB |
Output is correct |
10 |
Correct |
13 ms |
6460 KB |
Output is correct |
11 |
Correct |
64 ms |
13144 KB |
Output is correct |
12 |
Correct |
18 ms |
7208 KB |
Output is correct |
13 |
Correct |
28 ms |
11652 KB |
Output is correct |
14 |
Correct |
6 ms |
5004 KB |
Output is correct |
15 |
Correct |
5 ms |
5196 KB |
Output is correct |
16 |
Correct |
158 ms |
20236 KB |
Output is correct |
17 |
Correct |
5 ms |
4940 KB |
Output is correct |
18 |
Correct |
4 ms |
4940 KB |
Output is correct |
19 |
Correct |
4 ms |
4940 KB |
Output is correct |
20 |
Correct |
470 ms |
37172 KB |
Output is correct |
21 |
Correct |
460 ms |
36564 KB |
Output is correct |
22 |
Correct |
409 ms |
36492 KB |
Output is correct |
23 |
Correct |
384 ms |
32672 KB |
Output is correct |
24 |
Correct |
112 ms |
19268 KB |
Output is correct |
25 |
Correct |
280 ms |
35484 KB |
Output is correct |
26 |
Correct |
267 ms |
35532 KB |
Output is correct |
27 |
Correct |
486 ms |
35608 KB |
Output is correct |
28 |
Correct |
491 ms |
35608 KB |
Output is correct |
29 |
Correct |
507 ms |
35932 KB |
Output is correct |
30 |
Correct |
483 ms |
36004 KB |
Output is correct |
31 |
Correct |
5 ms |
4960 KB |
Output is correct |
32 |
Correct |
25 ms |
7192 KB |
Output is correct |
33 |
Correct |
74 ms |
14328 KB |
Output is correct |
34 |
Correct |
500 ms |
37056 KB |
Output is correct |
35 |
Correct |
14 ms |
6440 KB |
Output is correct |
36 |
Correct |
47 ms |
12760 KB |
Output is correct |
37 |
Correct |
108 ms |
20628 KB |
Output is correct |
38 |
Correct |
213 ms |
17616 KB |
Output is correct |
39 |
Correct |
243 ms |
22236 KB |
Output is correct |
40 |
Correct |
396 ms |
27816 KB |
Output is correct |
41 |
Correct |
322 ms |
32272 KB |
Output is correct |
42 |
Correct |
416 ms |
36260 KB |
Output is correct |
43 |
Correct |
5 ms |
4940 KB |
Output is correct |
44 |
Correct |
5 ms |
4960 KB |
Output is correct |
45 |
Correct |
5 ms |
4940 KB |
Output is correct |
46 |
Correct |
7 ms |
4940 KB |
Output is correct |
47 |
Correct |
4 ms |
4940 KB |
Output is correct |
48 |
Correct |
4 ms |
4936 KB |
Output is correct |
49 |
Correct |
4 ms |
4940 KB |
Output is correct |
50 |
Correct |
4 ms |
4940 KB |
Output is correct |
51 |
Correct |
4 ms |
4940 KB |
Output is correct |
52 |
Correct |
4 ms |
4940 KB |
Output is correct |
53 |
Correct |
4 ms |
4940 KB |
Output is correct |
54 |
Correct |
7 ms |
5196 KB |
Output is correct |
55 |
Correct |
6 ms |
5324 KB |
Output is correct |
56 |
Correct |
216 ms |
20216 KB |
Output is correct |
57 |
Correct |
304 ms |
28236 KB |
Output is correct |
58 |
Correct |
273 ms |
28256 KB |
Output is correct |
59 |
Correct |
5 ms |
4940 KB |
Output is correct |
60 |
Correct |
5 ms |
4940 KB |
Output is correct |
61 |
Correct |
4 ms |
4940 KB |
Output is correct |
62 |
Correct |
458 ms |
35548 KB |
Output is correct |
63 |
Correct |
454 ms |
35544 KB |
Output is correct |
64 |
Correct |
484 ms |
35400 KB |
Output is correct |
65 |
Correct |
22 ms |
5580 KB |
Output is correct |
66 |
Correct |
12 ms |
6188 KB |
Output is correct |
67 |
Correct |
245 ms |
20216 KB |
Output is correct |
68 |
Correct |
353 ms |
28404 KB |
Output is correct |
69 |
Correct |
462 ms |
35532 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
4940 KB |
Output is correct |
2 |
Correct |
5 ms |
4940 KB |
Output is correct |
3 |
Correct |
4 ms |
4940 KB |
Output is correct |
4 |
Correct |
5 ms |
4940 KB |
Output is correct |
5 |
Correct |
4 ms |
4940 KB |
Output is correct |
6 |
Correct |
5 ms |
4940 KB |
Output is correct |
7 |
Correct |
5 ms |
4940 KB |
Output is correct |
8 |
Correct |
4 ms |
4940 KB |
Output is correct |
9 |
Correct |
156 ms |
20204 KB |
Output is correct |
10 |
Correct |
13 ms |
6460 KB |
Output is correct |
11 |
Correct |
64 ms |
13144 KB |
Output is correct |
12 |
Correct |
18 ms |
7208 KB |
Output is correct |
13 |
Correct |
28 ms |
11652 KB |
Output is correct |
14 |
Correct |
6 ms |
5004 KB |
Output is correct |
15 |
Correct |
5 ms |
5196 KB |
Output is correct |
16 |
Correct |
158 ms |
20236 KB |
Output is correct |
17 |
Correct |
461 ms |
36320 KB |
Output is correct |
18 |
Correct |
427 ms |
36332 KB |
Output is correct |
19 |
Correct |
427 ms |
36468 KB |
Output is correct |
20 |
Correct |
493 ms |
37660 KB |
Output is correct |
21 |
Correct |
364 ms |
33868 KB |
Output is correct |
22 |
Correct |
4 ms |
4940 KB |
Output is correct |
23 |
Correct |
45 ms |
10108 KB |
Output is correct |
24 |
Correct |
26 ms |
8164 KB |
Output is correct |
25 |
Correct |
108 ms |
16152 KB |
Output is correct |
26 |
Correct |
155 ms |
24196 KB |
Output is correct |
27 |
Correct |
273 ms |
21500 KB |
Output is correct |
28 |
Correct |
229 ms |
26804 KB |
Output is correct |
29 |
Correct |
334 ms |
30560 KB |
Output is correct |
30 |
Correct |
448 ms |
34168 KB |
Output is correct |
31 |
Correct |
516 ms |
37724 KB |
Output is correct |
32 |
Correct |
480 ms |
37136 KB |
Output is correct |
33 |
Correct |
414 ms |
35512 KB |
Output is correct |
34 |
Correct |
8 ms |
5708 KB |
Output is correct |
35 |
Correct |
23 ms |
6352 KB |
Output is correct |
36 |
Correct |
184 ms |
20692 KB |
Output is correct |
37 |
Correct |
331 ms |
29884 KB |
Output is correct |
38 |
Correct |
512 ms |
36376 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
4940 KB |
Output is correct |
2 |
Correct |
5 ms |
4940 KB |
Output is correct |
3 |
Correct |
4 ms |
4940 KB |
Output is correct |
4 |
Correct |
5 ms |
4940 KB |
Output is correct |
5 |
Correct |
4 ms |
4940 KB |
Output is correct |
6 |
Correct |
5 ms |
4940 KB |
Output is correct |
7 |
Correct |
5 ms |
4940 KB |
Output is correct |
8 |
Correct |
4 ms |
4940 KB |
Output is correct |
9 |
Correct |
156 ms |
20204 KB |
Output is correct |
10 |
Correct |
13 ms |
6460 KB |
Output is correct |
11 |
Correct |
64 ms |
13144 KB |
Output is correct |
12 |
Correct |
18 ms |
7208 KB |
Output is correct |
13 |
Correct |
28 ms |
11652 KB |
Output is correct |
14 |
Correct |
6 ms |
5004 KB |
Output is correct |
15 |
Correct |
5 ms |
5196 KB |
Output is correct |
16 |
Correct |
158 ms |
20236 KB |
Output is correct |
17 |
Correct |
4 ms |
4940 KB |
Output is correct |
18 |
Correct |
8 ms |
4940 KB |
Output is correct |
19 |
Correct |
4 ms |
4940 KB |
Output is correct |
20 |
Correct |
5 ms |
4940 KB |
Output is correct |
21 |
Correct |
5 ms |
4912 KB |
Output is correct |
22 |
Correct |
5 ms |
4888 KB |
Output is correct |
23 |
Correct |
480 ms |
37880 KB |
Output is correct |
24 |
Correct |
0 ms |
4940 KB |
Output is correct |
25 |
Correct |
7 ms |
5196 KB |
Output is correct |
26 |
Correct |
6 ms |
5452 KB |
Output is correct |
27 |
Correct |
9 ms |
5580 KB |
Output is correct |
28 |
Correct |
148 ms |
18244 KB |
Output is correct |
29 |
Correct |
231 ms |
24488 KB |
Output is correct |
30 |
Correct |
346 ms |
31592 KB |
Output is correct |
31 |
Correct |
505 ms |
37908 KB |
Output is correct |
32 |
Correct |
4 ms |
4940 KB |
Output is correct |
33 |
Correct |
4 ms |
4940 KB |
Output is correct |
34 |
Correct |
17 ms |
4940 KB |
Output is correct |
35 |
Correct |
5 ms |
4940 KB |
Output is correct |
36 |
Correct |
4 ms |
4940 KB |
Output is correct |
37 |
Correct |
5 ms |
4940 KB |
Output is correct |
38 |
Correct |
4 ms |
4940 KB |
Output is correct |
39 |
Correct |
5 ms |
4940 KB |
Output is correct |
40 |
Correct |
5 ms |
4940 KB |
Output is correct |
41 |
Correct |
4 ms |
4940 KB |
Output is correct |
42 |
Correct |
4 ms |
4940 KB |
Output is correct |
43 |
Correct |
5 ms |
5196 KB |
Output is correct |
44 |
Correct |
8 ms |
5436 KB |
Output is correct |
45 |
Correct |
188 ms |
20172 KB |
Output is correct |
46 |
Correct |
265 ms |
28288 KB |
Output is correct |
47 |
Correct |
342 ms |
28260 KB |
Output is correct |
48 |
Correct |
7 ms |
4940 KB |
Output is correct |
49 |
Correct |
6 ms |
4940 KB |
Output is correct |
50 |
Correct |
4 ms |
4940 KB |
Output is correct |
51 |
Correct |
5 ms |
4980 KB |
Output is correct |
52 |
Correct |
6 ms |
4940 KB |
Output is correct |
53 |
Correct |
6 ms |
4940 KB |
Output is correct |
54 |
Correct |
5 ms |
4940 KB |
Output is correct |
55 |
Correct |
514 ms |
38512 KB |
Output is correct |
56 |
Correct |
4 ms |
4940 KB |
Output is correct |
57 |
Correct |
6 ms |
5324 KB |
Output is correct |
58 |
Correct |
13 ms |
5988 KB |
Output is correct |
59 |
Correct |
16 ms |
6552 KB |
Output is correct |
60 |
Correct |
212 ms |
21696 KB |
Output is correct |
61 |
Correct |
303 ms |
28336 KB |
Output is correct |
62 |
Correct |
519 ms |
33388 KB |
Output is correct |
63 |
Correct |
504 ms |
38544 KB |
Output is correct |
64 |
Correct |
4 ms |
4940 KB |
Output is correct |
65 |
Correct |
5 ms |
4940 KB |
Output is correct |
66 |
Correct |
4 ms |
4940 KB |
Output is correct |
67 |
Correct |
396 ms |
35528 KB |
Output is correct |
68 |
Correct |
413 ms |
35528 KB |
Output is correct |
69 |
Correct |
447 ms |
35396 KB |
Output is correct |
70 |
Correct |
9 ms |
5580 KB |
Output is correct |
71 |
Correct |
15 ms |
6188 KB |
Output is correct |
72 |
Correct |
244 ms |
20244 KB |
Output is correct |
73 |
Correct |
340 ms |
28476 KB |
Output is correct |
74 |
Correct |
582 ms |
35488 KB |
Output is correct |
75 |
Correct |
529 ms |
37248 KB |
Output is correct |
76 |
Correct |
516 ms |
35544 KB |
Output is correct |
77 |
Correct |
10 ms |
5708 KB |
Output is correct |
78 |
Correct |
15 ms |
6356 KB |
Output is correct |
79 |
Correct |
237 ms |
20648 KB |
Output is correct |
80 |
Correct |
286 ms |
29820 KB |
Output is correct |
81 |
Correct |
509 ms |
36432 KB |
Output is correct |
82 |
Correct |
5 ms |
4940 KB |
Output is correct |
83 |
Correct |
4 ms |
4940 KB |
Output is correct |
84 |
Correct |
4 ms |
4940 KB |
Output is correct |
85 |
Correct |
470 ms |
37172 KB |
Output is correct |
86 |
Correct |
460 ms |
36564 KB |
Output is correct |
87 |
Correct |
409 ms |
36492 KB |
Output is correct |
88 |
Correct |
384 ms |
32672 KB |
Output is correct |
89 |
Correct |
112 ms |
19268 KB |
Output is correct |
90 |
Correct |
280 ms |
35484 KB |
Output is correct |
91 |
Correct |
267 ms |
35532 KB |
Output is correct |
92 |
Correct |
486 ms |
35608 KB |
Output is correct |
93 |
Correct |
491 ms |
35608 KB |
Output is correct |
94 |
Correct |
507 ms |
35932 KB |
Output is correct |
95 |
Correct |
483 ms |
36004 KB |
Output is correct |
96 |
Correct |
5 ms |
4960 KB |
Output is correct |
97 |
Correct |
25 ms |
7192 KB |
Output is correct |
98 |
Correct |
74 ms |
14328 KB |
Output is correct |
99 |
Correct |
500 ms |
37056 KB |
Output is correct |
100 |
Correct |
14 ms |
6440 KB |
Output is correct |
101 |
Correct |
47 ms |
12760 KB |
Output is correct |
102 |
Correct |
108 ms |
20628 KB |
Output is correct |
103 |
Correct |
213 ms |
17616 KB |
Output is correct |
104 |
Correct |
243 ms |
22236 KB |
Output is correct |
105 |
Correct |
396 ms |
27816 KB |
Output is correct |
106 |
Correct |
322 ms |
32272 KB |
Output is correct |
107 |
Correct |
416 ms |
36260 KB |
Output is correct |
108 |
Correct |
5 ms |
4940 KB |
Output is correct |
109 |
Correct |
5 ms |
4960 KB |
Output is correct |
110 |
Correct |
5 ms |
4940 KB |
Output is correct |
111 |
Correct |
7 ms |
4940 KB |
Output is correct |
112 |
Correct |
4 ms |
4940 KB |
Output is correct |
113 |
Correct |
4 ms |
4936 KB |
Output is correct |
114 |
Correct |
4 ms |
4940 KB |
Output is correct |
115 |
Correct |
4 ms |
4940 KB |
Output is correct |
116 |
Correct |
4 ms |
4940 KB |
Output is correct |
117 |
Correct |
4 ms |
4940 KB |
Output is correct |
118 |
Correct |
4 ms |
4940 KB |
Output is correct |
119 |
Correct |
7 ms |
5196 KB |
Output is correct |
120 |
Correct |
6 ms |
5324 KB |
Output is correct |
121 |
Correct |
216 ms |
20216 KB |
Output is correct |
122 |
Correct |
304 ms |
28236 KB |
Output is correct |
123 |
Correct |
273 ms |
28256 KB |
Output is correct |
124 |
Correct |
5 ms |
4940 KB |
Output is correct |
125 |
Correct |
5 ms |
4940 KB |
Output is correct |
126 |
Correct |
4 ms |
4940 KB |
Output is correct |
127 |
Correct |
458 ms |
35548 KB |
Output is correct |
128 |
Correct |
454 ms |
35544 KB |
Output is correct |
129 |
Correct |
484 ms |
35400 KB |
Output is correct |
130 |
Correct |
22 ms |
5580 KB |
Output is correct |
131 |
Correct |
12 ms |
6188 KB |
Output is correct |
132 |
Correct |
245 ms |
20216 KB |
Output is correct |
133 |
Correct |
353 ms |
28404 KB |
Output is correct |
134 |
Correct |
462 ms |
35532 KB |
Output is correct |
135 |
Correct |
461 ms |
36320 KB |
Output is correct |
136 |
Correct |
427 ms |
36332 KB |
Output is correct |
137 |
Correct |
427 ms |
36468 KB |
Output is correct |
138 |
Correct |
493 ms |
37660 KB |
Output is correct |
139 |
Correct |
364 ms |
33868 KB |
Output is correct |
140 |
Correct |
4 ms |
4940 KB |
Output is correct |
141 |
Correct |
45 ms |
10108 KB |
Output is correct |
142 |
Correct |
26 ms |
8164 KB |
Output is correct |
143 |
Correct |
108 ms |
16152 KB |
Output is correct |
144 |
Correct |
155 ms |
24196 KB |
Output is correct |
145 |
Correct |
273 ms |
21500 KB |
Output is correct |
146 |
Correct |
229 ms |
26804 KB |
Output is correct |
147 |
Correct |
334 ms |
30560 KB |
Output is correct |
148 |
Correct |
448 ms |
34168 KB |
Output is correct |
149 |
Correct |
516 ms |
37724 KB |
Output is correct |
150 |
Correct |
480 ms |
37136 KB |
Output is correct |
151 |
Correct |
414 ms |
35512 KB |
Output is correct |
152 |
Correct |
8 ms |
5708 KB |
Output is correct |
153 |
Correct |
23 ms |
6352 KB |
Output is correct |
154 |
Correct |
184 ms |
20692 KB |
Output is correct |
155 |
Correct |
331 ms |
29884 KB |
Output is correct |
156 |
Correct |
512 ms |
36376 KB |
Output is correct |
157 |
Correct |
5 ms |
4940 KB |
Output is correct |
158 |
Correct |
5 ms |
4932 KB |
Output is correct |
159 |
Correct |
5 ms |
4940 KB |
Output is correct |
160 |
Correct |
5 ms |
4940 KB |
Output is correct |
161 |
Correct |
548 ms |
39960 KB |
Output is correct |
162 |
Correct |
592 ms |
37016 KB |
Output is correct |
163 |
Correct |
509 ms |
39420 KB |
Output is correct |
164 |
Correct |
468 ms |
39408 KB |
Output is correct |
165 |
Correct |
482 ms |
40992 KB |
Output is correct |
166 |
Correct |
509 ms |
41588 KB |
Output is correct |
167 |
Correct |
102 ms |
13068 KB |
Output is correct |
168 |
Correct |
33 ms |
10208 KB |
Output is correct |
169 |
Correct |
107 ms |
18768 KB |
Output is correct |
170 |
Correct |
285 ms |
31068 KB |
Output is correct |
171 |
Correct |
393 ms |
39912 KB |
Output is correct |
172 |
Correct |
244 ms |
22936 KB |
Output is correct |
173 |
Correct |
344 ms |
26040 KB |
Output is correct |
174 |
Correct |
305 ms |
30756 KB |
Output is correct |
175 |
Correct |
400 ms |
34056 KB |
Output is correct |
176 |
Correct |
478 ms |
36920 KB |
Output is correct |
177 |
Correct |
561 ms |
40252 KB |
Output is correct |