#include "parks.h"
#include "bits/stdc++.h"
using namespace std;
struct Po {
int x, y, f;
};
bool operator<(const Po& l, const Po& r) {
return tie(l.x, l.y) < tie(r.x, r.y);
}
bool operator==(const Po& l, const Po& r) {
return tie(l.x, l.y) == tie(r.x, r.y);
}
struct Ed {
int s, t;
Po be;
};
int find(int x, vector<int>& p) {
if (p[x] == x) return x;
return p[x] = find(p[x], p);
}
void unite(int a, int b, vector<int>& p) {
a = find(a, p);
b = find(b, p);
p[a] = b;
}
using g_t = map<Po, set<Po>>;
int construct_roads(std::vector<int> x, std::vector<int> y) {
vector<int> p(x.size());
set<Po> par;
for (int i = 0; i < x.size(); ++i) {
p[i] = i;
par.insert({x[i], y[i], i});
}
vector<Ed> eds;
for (int i = 0; i < x.size(); ++i) {
if (x[i] != 4 && par.find({x[i], y[i] + 2}) != par.end() && find(par.find({x[i], y[i] + 2})->f, p) != find(i, p)) {
eds.push_back({par.find({x[i], y[i] + 2})->f, i});
unite(par.find({x[i], y[i] + 2})->f, i, p);
}
}
for (int i = 0; i < x.size(); ++i) {
if (par.find({x[i] + 2, y[i]}) != par.end() && find(par.find({x[i] + 2, y[i]})->f, p) != find(i, p)) {
eds.push_back({par.find({x[i] + 2, y[i]})->f, i});
unite(par.find({x[i] + 2, y[i]})->f, i, p);
}
}
for (int i = 0; i < x.size(); ++i) {
if (par.find({x[i], y[i] + 2}) != par.end() && find(par.find({x[i], y[i] + 2})->f, p) != find(i, p)) {
eds.push_back({par.find({x[i], y[i] + 2})->f, i});
unite(par.find({x[i], y[i] + 2})->f, i, p);
}
}
if (eds.size() + 1 < x.size()) return 0;
g_t g;
for (int j = 0; j < eds.size(); ++j) {
if (x[eds[j].s] == x[eds[j].t]) {
g[{x[eds[j].s] + 1, (y[eds[j].s] + y[eds[j].t])/2}].insert({x[eds[j].s] - 1,(y[eds[j].s] + y[eds[j].t])/2, j});
g[{x[eds[j].s] - 1, (y[eds[j].s] + y[eds[j].t])/2}].insert({x[eds[j].s] + 1,(y[eds[j].s] + y[eds[j].t])/2, j});
} else {
g[{(x[eds[j].s] + x[eds[j].t] )/ 2, y[eds[j].s] + 1}].insert({(x[eds[j].s] + x[eds[j].t] )/ 2, y[eds[j].s] - 1, j});
g[{(x[eds[j].s] + x[eds[j].t] )/ 2, y[eds[j].s] - 1}].insert({(x[eds[j].s] + x[eds[j].t] )/ 2, y[eds[j].s] + 1, j});
}
}
queue<Po> ne;
for (auto [st, en]: g) {
if (en.size() == 1) ne.push(st);
}
while (!ne.empty()) {
auto to = ne.front();
ne.pop();
if (g[to].empty()) {
g.erase(to);
continue;
}
eds[g[to].begin()->f].be = to;
g[{g[to].begin()->x, g[to].begin()->y}].erase({to.x, to.y, g[to].begin()->f});
if (g[{g[to].begin()->x, g[to].begin()->y}].size() == 1) ne.push({g[to].begin()->x, g[to].begin()->y});
g.erase(to);
}
while (!g.empty()) {
if (g.begin()->second.empty()) g.erase(g.begin());
else {
assert(g.begin()->second.size() == 2);
auto to = g.begin()->first;
eds[g[to].begin()->f].be = to;
g[{g[to].begin()->x, g[to].begin()->y}].erase({to.x, to.y, g[to].begin()->f});
if (g[{g[to].begin()->x, g[to].begin()->y}].size() == 1) ne.push({g[to].begin()->x, g[to].begin()->y});
while (!ne.empty()) {
to = ne.front();
ne.pop();
if (g[to].empty()) {
g.erase(to);
continue;
}
eds[g[to].begin()->f].be = to;
g[{g[to].begin()->x, g[to].begin()->y}].erase({to.x, to.y, g[to].begin()->f});
if (g[{g[to].begin()->x, g[to].begin()->y}].size() == 1) ne.push({g[to].begin()->x, g[to].begin()->y});
g.erase(to);
}
}
}
vector<int> u(eds.size()), v(eds.size()), a(eds.size()), b(eds.size());
for (int i = 0; i < eds.size(); ++i) {
tie(u[i], v[i], a[i], b[i]) = tie(eds[i].s, eds[i].t, eds[i].be.x, eds[i].be.y);
}
build(u, v, a, b);
return 1;
}
Compilation message
parks.cpp: In function 'int construct_roads(std::vector<int>, std::vector<int>)':
parks.cpp:39:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
39 | for (int i = 0; i < x.size(); ++i) {
| ~~^~~~~~~~~~
parks.cpp:44:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
44 | for (int i = 0; i < x.size(); ++i) {
| ~~^~~~~~~~~~
parks.cpp:50:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
50 | for (int i = 0; i < x.size(); ++i) {
| ~~^~~~~~~~~~
parks.cpp:56:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
56 | for (int i = 0; i < x.size(); ++i) {
| ~~^~~~~~~~~~
parks.cpp:65:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<Ed>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
65 | for (int j = 0; j < eds.size(); ++j) {
| ~~^~~~~~~~~~~~
parks.cpp:113:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<Ed>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
113 | for (int i = 0; i < eds.size(); ++i) {
| ~~^~~~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
360 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
301 ms |
47404 KB |
Output is correct |
10 |
Correct |
14 ms |
5076 KB |
Output is correct |
11 |
Correct |
98 ms |
25676 KB |
Output is correct |
12 |
Correct |
21 ms |
7408 KB |
Output is correct |
13 |
Correct |
30 ms |
5464 KB |
Output is correct |
14 |
Correct |
1 ms |
348 KB |
Output is correct |
15 |
Correct |
1 ms |
604 KB |
Output is correct |
16 |
Correct |
260 ms |
47260 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
360 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
301 ms |
47404 KB |
Output is correct |
10 |
Correct |
14 ms |
5076 KB |
Output is correct |
11 |
Correct |
98 ms |
25676 KB |
Output is correct |
12 |
Correct |
21 ms |
7408 KB |
Output is correct |
13 |
Correct |
30 ms |
5464 KB |
Output is correct |
14 |
Correct |
1 ms |
348 KB |
Output is correct |
15 |
Correct |
1 ms |
604 KB |
Output is correct |
16 |
Correct |
260 ms |
47260 KB |
Output is correct |
17 |
Correct |
0 ms |
344 KB |
Output is correct |
18 |
Correct |
0 ms |
344 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 |
566 ms |
68808 KB |
Output is correct |
24 |
Correct |
1 ms |
348 KB |
Output is correct |
25 |
Correct |
1 ms |
604 KB |
Output is correct |
26 |
Correct |
2 ms |
604 KB |
Output is correct |
27 |
Correct |
3 ms |
860 KB |
Output is correct |
28 |
Correct |
170 ms |
28716 KB |
Output is correct |
29 |
Correct |
278 ms |
41312 KB |
Output is correct |
30 |
Correct |
429 ms |
55396 KB |
Output is correct |
31 |
Correct |
540 ms |
69816 KB |
Output is correct |
32 |
Correct |
0 ms |
344 KB |
Output is correct |
33 |
Correct |
0 ms |
348 KB |
Output is correct |
34 |
Correct |
0 ms |
348 KB |
Output is correct |
35 |
Correct |
0 ms |
348 KB |
Output is correct |
36 |
Correct |
0 ms |
348 KB |
Output is correct |
37 |
Correct |
0 ms |
348 KB |
Output is correct |
38 |
Correct |
0 ms |
348 KB |
Output is correct |
39 |
Correct |
0 ms |
348 KB |
Output is correct |
40 |
Correct |
0 ms |
348 KB |
Output is correct |
41 |
Correct |
0 ms |
348 KB |
Output is correct |
42 |
Correct |
0 ms |
348 KB |
Output is correct |
43 |
Correct |
1 ms |
604 KB |
Output is correct |
44 |
Correct |
2 ms |
604 KB |
Output is correct |
45 |
Correct |
275 ms |
39156 KB |
Output is correct |
46 |
Correct |
399 ms |
57784 KB |
Output is correct |
47 |
Correct |
405 ms |
56476 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
360 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
301 ms |
47404 KB |
Output is correct |
10 |
Correct |
14 ms |
5076 KB |
Output is correct |
11 |
Correct |
98 ms |
25676 KB |
Output is correct |
12 |
Correct |
21 ms |
7408 KB |
Output is correct |
13 |
Correct |
30 ms |
5464 KB |
Output is correct |
14 |
Correct |
1 ms |
348 KB |
Output is correct |
15 |
Correct |
1 ms |
604 KB |
Output is correct |
16 |
Correct |
260 ms |
47260 KB |
Output is correct |
17 |
Correct |
0 ms |
344 KB |
Output is correct |
18 |
Correct |
0 ms |
344 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 |
566 ms |
68808 KB |
Output is correct |
24 |
Correct |
1 ms |
348 KB |
Output is correct |
25 |
Correct |
1 ms |
604 KB |
Output is correct |
26 |
Correct |
2 ms |
604 KB |
Output is correct |
27 |
Correct |
3 ms |
860 KB |
Output is correct |
28 |
Correct |
170 ms |
28716 KB |
Output is correct |
29 |
Correct |
278 ms |
41312 KB |
Output is correct |
30 |
Correct |
429 ms |
55396 KB |
Output is correct |
31 |
Correct |
540 ms |
69816 KB |
Output is correct |
32 |
Correct |
0 ms |
344 KB |
Output is correct |
33 |
Correct |
0 ms |
348 KB |
Output is correct |
34 |
Correct |
0 ms |
348 KB |
Output is correct |
35 |
Correct |
0 ms |
348 KB |
Output is correct |
36 |
Correct |
0 ms |
348 KB |
Output is correct |
37 |
Correct |
0 ms |
348 KB |
Output is correct |
38 |
Correct |
0 ms |
348 KB |
Output is correct |
39 |
Correct |
0 ms |
348 KB |
Output is correct |
40 |
Correct |
0 ms |
348 KB |
Output is correct |
41 |
Correct |
0 ms |
348 KB |
Output is correct |
42 |
Correct |
0 ms |
348 KB |
Output is correct |
43 |
Correct |
1 ms |
604 KB |
Output is correct |
44 |
Correct |
2 ms |
604 KB |
Output is correct |
45 |
Correct |
275 ms |
39156 KB |
Output is correct |
46 |
Correct |
399 ms |
57784 KB |
Output is correct |
47 |
Correct |
405 ms |
56476 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 |
0 ms |
348 KB |
Output is correct |
55 |
Correct |
648 ms |
77528 KB |
Output is correct |
56 |
Correct |
1 ms |
344 KB |
Output is correct |
57 |
Correct |
3 ms |
1116 KB |
Output is correct |
58 |
Correct |
10 ms |
2756 KB |
Output is correct |
59 |
Correct |
8 ms |
1596 KB |
Output is correct |
60 |
Correct |
247 ms |
39328 KB |
Output is correct |
61 |
Correct |
387 ms |
54568 KB |
Output is correct |
62 |
Correct |
486 ms |
66236 KB |
Output is correct |
63 |
Correct |
654 ms |
78772 KB |
Output is correct |
64 |
Correct |
0 ms |
344 KB |
Output is correct |
65 |
Correct |
0 ms |
344 KB |
Output is correct |
66 |
Correct |
0 ms |
348 KB |
Output is correct |
67 |
Correct |
623 ms |
97220 KB |
Output is correct |
68 |
Correct |
698 ms |
95928 KB |
Output is correct |
69 |
Correct |
632 ms |
95672 KB |
Output is correct |
70 |
Correct |
3 ms |
856 KB |
Output is correct |
71 |
Correct |
6 ms |
1372 KB |
Output is correct |
72 |
Correct |
262 ms |
39196 KB |
Output is correct |
73 |
Correct |
448 ms |
59572 KB |
Output is correct |
74 |
Correct |
682 ms |
79100 KB |
Output is correct |
75 |
Correct |
627 ms |
85744 KB |
Output is correct |
76 |
Correct |
600 ms |
96172 KB |
Output is correct |
77 |
Correct |
4 ms |
1116 KB |
Output is correct |
78 |
Correct |
7 ms |
1596 KB |
Output is correct |
79 |
Correct |
267 ms |
40416 KB |
Output is correct |
80 |
Correct |
470 ms |
62092 KB |
Output is correct |
81 |
Correct |
681 ms |
81916 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
360 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
301 ms |
47404 KB |
Output is correct |
10 |
Correct |
14 ms |
5076 KB |
Output is correct |
11 |
Correct |
98 ms |
25676 KB |
Output is correct |
12 |
Correct |
21 ms |
7408 KB |
Output is correct |
13 |
Correct |
30 ms |
5464 KB |
Output is correct |
14 |
Correct |
1 ms |
348 KB |
Output is correct |
15 |
Correct |
1 ms |
604 KB |
Output is correct |
16 |
Correct |
260 ms |
47260 KB |
Output is correct |
17 |
Correct |
0 ms |
348 KB |
Output is correct |
18 |
Correct |
0 ms |
348 KB |
Output is correct |
19 |
Correct |
0 ms |
348 KB |
Output is correct |
20 |
Correct |
626 ms |
68128 KB |
Output is correct |
21 |
Correct |
598 ms |
67824 KB |
Output is correct |
22 |
Correct |
593 ms |
68536 KB |
Output is correct |
23 |
Correct |
500 ms |
81596 KB |
Output is correct |
24 |
Correct |
179 ms |
16724 KB |
Output is correct |
25 |
Correct |
243 ms |
24252 KB |
Output is correct |
26 |
Correct |
249 ms |
23248 KB |
Output is correct |
27 |
Correct |
642 ms |
94392 KB |
Output is correct |
28 |
Correct |
634 ms |
94392 KB |
Output is correct |
29 |
Correct |
578 ms |
94392 KB |
Output is correct |
30 |
Correct |
562 ms |
94396 KB |
Output is correct |
31 |
Correct |
0 ms |
344 KB |
Output is correct |
32 |
Correct |
29 ms |
5720 KB |
Output is correct |
33 |
Correct |
108 ms |
8396 KB |
Output is correct |
34 |
Correct |
532 ms |
67924 KB |
Output is correct |
35 |
Correct |
8 ms |
1592 KB |
Output is correct |
36 |
Correct |
55 ms |
5708 KB |
Output is correct |
37 |
Correct |
120 ms |
11204 KB |
Output is correct |
38 |
Correct |
217 ms |
29300 KB |
Output is correct |
39 |
Correct |
310 ms |
40128 KB |
Output is correct |
40 |
Correct |
444 ms |
51040 KB |
Output is correct |
41 |
Correct |
598 ms |
62692 KB |
Output is correct |
42 |
Correct |
759 ms |
73656 KB |
Output is correct |
43 |
Correct |
0 ms |
344 KB |
Output is correct |
44 |
Correct |
1 ms |
344 KB |
Output is correct |
45 |
Correct |
0 ms |
348 KB |
Output is correct |
46 |
Correct |
0 ms |
348 KB |
Output is correct |
47 |
Correct |
0 ms |
388 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 |
1 ms |
604 KB |
Output is correct |
55 |
Correct |
2 ms |
604 KB |
Output is correct |
56 |
Correct |
242 ms |
39536 KB |
Output is correct |
57 |
Correct |
421 ms |
57788 KB |
Output is correct |
58 |
Correct |
390 ms |
58552 KB |
Output is correct |
59 |
Correct |
0 ms |
348 KB |
Output is correct |
60 |
Correct |
0 ms |
348 KB |
Output is correct |
61 |
Correct |
0 ms |
348 KB |
Output is correct |
62 |
Correct |
633 ms |
95244 KB |
Output is correct |
63 |
Correct |
616 ms |
95136 KB |
Output is correct |
64 |
Correct |
610 ms |
94908 KB |
Output is correct |
65 |
Correct |
3 ms |
860 KB |
Output is correct |
66 |
Correct |
6 ms |
1340 KB |
Output is correct |
67 |
Correct |
265 ms |
38360 KB |
Output is correct |
68 |
Correct |
467 ms |
59244 KB |
Output is correct |
69 |
Correct |
665 ms |
76472 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
360 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
301 ms |
47404 KB |
Output is correct |
10 |
Correct |
14 ms |
5076 KB |
Output is correct |
11 |
Correct |
98 ms |
25676 KB |
Output is correct |
12 |
Correct |
21 ms |
7408 KB |
Output is correct |
13 |
Correct |
30 ms |
5464 KB |
Output is correct |
14 |
Correct |
1 ms |
348 KB |
Output is correct |
15 |
Correct |
1 ms |
604 KB |
Output is correct |
16 |
Correct |
260 ms |
47260 KB |
Output is correct |
17 |
Correct |
569 ms |
95036 KB |
Output is correct |
18 |
Correct |
542 ms |
95296 KB |
Output is correct |
19 |
Correct |
564 ms |
67892 KB |
Output is correct |
20 |
Correct |
724 ms |
75400 KB |
Output is correct |
21 |
Correct |
588 ms |
76036 KB |
Output is correct |
22 |
Correct |
0 ms |
344 KB |
Output is correct |
23 |
Correct |
72 ms |
12212 KB |
Output is correct |
24 |
Correct |
23 ms |
2716 KB |
Output is correct |
25 |
Correct |
90 ms |
9672 KB |
Output is correct |
26 |
Correct |
151 ms |
14024 KB |
Output is correct |
27 |
Correct |
315 ms |
38084 KB |
Output is correct |
28 |
Correct |
418 ms |
46924 KB |
Output is correct |
29 |
Correct |
507 ms |
57784 KB |
Output is correct |
30 |
Correct |
629 ms |
65728 KB |
Output is correct |
31 |
Correct |
743 ms |
74940 KB |
Output is correct |
32 |
Correct |
640 ms |
84408 KB |
Output is correct |
33 |
Correct |
631 ms |
95048 KB |
Output is correct |
34 |
Correct |
4 ms |
860 KB |
Output is correct |
35 |
Correct |
7 ms |
1624 KB |
Output is correct |
36 |
Correct |
278 ms |
39644 KB |
Output is correct |
37 |
Correct |
482 ms |
60860 KB |
Output is correct |
38 |
Correct |
640 ms |
79244 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
360 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
301 ms |
47404 KB |
Output is correct |
10 |
Correct |
14 ms |
5076 KB |
Output is correct |
11 |
Correct |
98 ms |
25676 KB |
Output is correct |
12 |
Correct |
21 ms |
7408 KB |
Output is correct |
13 |
Correct |
30 ms |
5464 KB |
Output is correct |
14 |
Correct |
1 ms |
348 KB |
Output is correct |
15 |
Correct |
1 ms |
604 KB |
Output is correct |
16 |
Correct |
260 ms |
47260 KB |
Output is correct |
17 |
Correct |
0 ms |
344 KB |
Output is correct |
18 |
Correct |
0 ms |
344 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 |
566 ms |
68808 KB |
Output is correct |
24 |
Correct |
1 ms |
348 KB |
Output is correct |
25 |
Correct |
1 ms |
604 KB |
Output is correct |
26 |
Correct |
2 ms |
604 KB |
Output is correct |
27 |
Correct |
3 ms |
860 KB |
Output is correct |
28 |
Correct |
170 ms |
28716 KB |
Output is correct |
29 |
Correct |
278 ms |
41312 KB |
Output is correct |
30 |
Correct |
429 ms |
55396 KB |
Output is correct |
31 |
Correct |
540 ms |
69816 KB |
Output is correct |
32 |
Correct |
0 ms |
344 KB |
Output is correct |
33 |
Correct |
0 ms |
348 KB |
Output is correct |
34 |
Correct |
0 ms |
348 KB |
Output is correct |
35 |
Correct |
0 ms |
348 KB |
Output is correct |
36 |
Correct |
0 ms |
348 KB |
Output is correct |
37 |
Correct |
0 ms |
348 KB |
Output is correct |
38 |
Correct |
0 ms |
348 KB |
Output is correct |
39 |
Correct |
0 ms |
348 KB |
Output is correct |
40 |
Correct |
0 ms |
348 KB |
Output is correct |
41 |
Correct |
0 ms |
348 KB |
Output is correct |
42 |
Correct |
0 ms |
348 KB |
Output is correct |
43 |
Correct |
1 ms |
604 KB |
Output is correct |
44 |
Correct |
2 ms |
604 KB |
Output is correct |
45 |
Correct |
275 ms |
39156 KB |
Output is correct |
46 |
Correct |
399 ms |
57784 KB |
Output is correct |
47 |
Correct |
405 ms |
56476 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 |
0 ms |
348 KB |
Output is correct |
55 |
Correct |
648 ms |
77528 KB |
Output is correct |
56 |
Correct |
1 ms |
344 KB |
Output is correct |
57 |
Correct |
3 ms |
1116 KB |
Output is correct |
58 |
Correct |
10 ms |
2756 KB |
Output is correct |
59 |
Correct |
8 ms |
1596 KB |
Output is correct |
60 |
Correct |
247 ms |
39328 KB |
Output is correct |
61 |
Correct |
387 ms |
54568 KB |
Output is correct |
62 |
Correct |
486 ms |
66236 KB |
Output is correct |
63 |
Correct |
654 ms |
78772 KB |
Output is correct |
64 |
Correct |
0 ms |
344 KB |
Output is correct |
65 |
Correct |
0 ms |
344 KB |
Output is correct |
66 |
Correct |
0 ms |
348 KB |
Output is correct |
67 |
Correct |
623 ms |
97220 KB |
Output is correct |
68 |
Correct |
698 ms |
95928 KB |
Output is correct |
69 |
Correct |
632 ms |
95672 KB |
Output is correct |
70 |
Correct |
3 ms |
856 KB |
Output is correct |
71 |
Correct |
6 ms |
1372 KB |
Output is correct |
72 |
Correct |
262 ms |
39196 KB |
Output is correct |
73 |
Correct |
448 ms |
59572 KB |
Output is correct |
74 |
Correct |
682 ms |
79100 KB |
Output is correct |
75 |
Correct |
627 ms |
85744 KB |
Output is correct |
76 |
Correct |
600 ms |
96172 KB |
Output is correct |
77 |
Correct |
4 ms |
1116 KB |
Output is correct |
78 |
Correct |
7 ms |
1596 KB |
Output is correct |
79 |
Correct |
267 ms |
40416 KB |
Output is correct |
80 |
Correct |
470 ms |
62092 KB |
Output is correct |
81 |
Correct |
681 ms |
81916 KB |
Output is correct |
82 |
Correct |
0 ms |
348 KB |
Output is correct |
83 |
Correct |
0 ms |
348 KB |
Output is correct |
84 |
Correct |
0 ms |
348 KB |
Output is correct |
85 |
Correct |
626 ms |
68128 KB |
Output is correct |
86 |
Correct |
598 ms |
67824 KB |
Output is correct |
87 |
Correct |
593 ms |
68536 KB |
Output is correct |
88 |
Correct |
500 ms |
81596 KB |
Output is correct |
89 |
Correct |
179 ms |
16724 KB |
Output is correct |
90 |
Correct |
243 ms |
24252 KB |
Output is correct |
91 |
Correct |
249 ms |
23248 KB |
Output is correct |
92 |
Correct |
642 ms |
94392 KB |
Output is correct |
93 |
Correct |
634 ms |
94392 KB |
Output is correct |
94 |
Correct |
578 ms |
94392 KB |
Output is correct |
95 |
Correct |
562 ms |
94396 KB |
Output is correct |
96 |
Correct |
0 ms |
344 KB |
Output is correct |
97 |
Correct |
29 ms |
5720 KB |
Output is correct |
98 |
Correct |
108 ms |
8396 KB |
Output is correct |
99 |
Correct |
532 ms |
67924 KB |
Output is correct |
100 |
Correct |
8 ms |
1592 KB |
Output is correct |
101 |
Correct |
55 ms |
5708 KB |
Output is correct |
102 |
Correct |
120 ms |
11204 KB |
Output is correct |
103 |
Correct |
217 ms |
29300 KB |
Output is correct |
104 |
Correct |
310 ms |
40128 KB |
Output is correct |
105 |
Correct |
444 ms |
51040 KB |
Output is correct |
106 |
Correct |
598 ms |
62692 KB |
Output is correct |
107 |
Correct |
759 ms |
73656 KB |
Output is correct |
108 |
Correct |
0 ms |
344 KB |
Output is correct |
109 |
Correct |
1 ms |
344 KB |
Output is correct |
110 |
Correct |
0 ms |
348 KB |
Output is correct |
111 |
Correct |
0 ms |
348 KB |
Output is correct |
112 |
Correct |
0 ms |
388 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 |
1 ms |
604 KB |
Output is correct |
120 |
Correct |
2 ms |
604 KB |
Output is correct |
121 |
Correct |
242 ms |
39536 KB |
Output is correct |
122 |
Correct |
421 ms |
57788 KB |
Output is correct |
123 |
Correct |
390 ms |
58552 KB |
Output is correct |
124 |
Correct |
0 ms |
348 KB |
Output is correct |
125 |
Correct |
0 ms |
348 KB |
Output is correct |
126 |
Correct |
0 ms |
348 KB |
Output is correct |
127 |
Correct |
633 ms |
95244 KB |
Output is correct |
128 |
Correct |
616 ms |
95136 KB |
Output is correct |
129 |
Correct |
610 ms |
94908 KB |
Output is correct |
130 |
Correct |
3 ms |
860 KB |
Output is correct |
131 |
Correct |
6 ms |
1340 KB |
Output is correct |
132 |
Correct |
265 ms |
38360 KB |
Output is correct |
133 |
Correct |
467 ms |
59244 KB |
Output is correct |
134 |
Correct |
665 ms |
76472 KB |
Output is correct |
135 |
Correct |
569 ms |
95036 KB |
Output is correct |
136 |
Correct |
542 ms |
95296 KB |
Output is correct |
137 |
Correct |
564 ms |
67892 KB |
Output is correct |
138 |
Correct |
724 ms |
75400 KB |
Output is correct |
139 |
Correct |
588 ms |
76036 KB |
Output is correct |
140 |
Correct |
0 ms |
344 KB |
Output is correct |
141 |
Correct |
72 ms |
12212 KB |
Output is correct |
142 |
Correct |
23 ms |
2716 KB |
Output is correct |
143 |
Correct |
90 ms |
9672 KB |
Output is correct |
144 |
Correct |
151 ms |
14024 KB |
Output is correct |
145 |
Correct |
315 ms |
38084 KB |
Output is correct |
146 |
Correct |
418 ms |
46924 KB |
Output is correct |
147 |
Correct |
507 ms |
57784 KB |
Output is correct |
148 |
Correct |
629 ms |
65728 KB |
Output is correct |
149 |
Correct |
743 ms |
74940 KB |
Output is correct |
150 |
Correct |
640 ms |
84408 KB |
Output is correct |
151 |
Correct |
631 ms |
95048 KB |
Output is correct |
152 |
Correct |
4 ms |
860 KB |
Output is correct |
153 |
Correct |
7 ms |
1624 KB |
Output is correct |
154 |
Correct |
278 ms |
39644 KB |
Output is correct |
155 |
Correct |
482 ms |
60860 KB |
Output is correct |
156 |
Correct |
640 ms |
79244 KB |
Output is correct |
157 |
Correct |
1 ms |
600 KB |
Output is correct |
158 |
Correct |
0 ms |
348 KB |
Output is correct |
159 |
Correct |
0 ms |
348 KB |
Output is correct |
160 |
Correct |
0 ms |
348 KB |
Output is correct |
161 |
Execution timed out |
3593 ms |
69572 KB |
Time limit exceeded |
162 |
Halted |
0 ms |
0 KB |
- |