#include "parks.h"
#include <bits/stdc++.h>
using namespace std;
const int nmax = 2e5 + 5;
using pii = pair<int,int>;
#define sz(x) ((int)(x).size())
map<pii, int> encr;
map<int, pii> decr;
vector<int> g[nmax];
int dirx[4] = {-2, 2, 0, 0}, diry[4] = {0, 0, 2, -2};
int occ[nmax];
vector<pii> edges;
void dfs(int node) {
occ[node] = 1;
for(auto x : g[node]) {
if(occ[x]) continue;
edges.emplace_back(node, x);
dfs(x);
}
return;
}
pair<vector<int>, vector<int>> unravel(vector<pii>& v) {
vector<int> a, b;
for(auto [x, y] : v) a.emplace_back(x), b.emplace_back(y);
return make_pair(a, b);
}
int construct_roads(std::vector<int> x, std::vector<int> y) {
for(int i = 0; i < sz(x); i++)
encr[make_pair(x[i], y[i])] = i;
for(auto [a, b] : encr) {
decr[b] = a;
for(int i = 0; i < 4; i++) {
if(encr.count(make_pair(a.first + dirx[i], a.second + diry[i])))
g[b].emplace_back(encr[make_pair(a.first + dirx[i], a.second + diry[i])]);
}
}
dfs(0);
if([&]() {
for(int i = 0; i < sz(x); i++) if(occ[i] == 0) return 1;
return 0;
}()) { return 0; }
map<pii, unordered_set<int>> adj;
vector<pii> avail[5];
for(int i = 0; i < sz(edges); i++) {
auto [x1, y1] = decr[edges[i].first];
auto [x2, y2] = decr[edges[i].second];
if(x1 == x2) {
adj[make_pair(x1 + 1, max(y1, y2) - 1)].emplace(i);
adj[make_pair(x1 - 1, max(y1, y2) - 1)].emplace(i);
}
else {
assert(y1 == y2);
adj[make_pair(max(x1, x2) - 1, y1 - 1)].emplace(i);
adj[make_pair(max(x1, x2) - 1, y1 + 1)].emplace(i);
}
}
//for(auto [a, b] : edges) {
//cerr << decr[a].first << ' ' << decr[a].second << " -- " << decr[b].first << ' ' << decr[b].second << '\n';
//}
for(auto [a, b] : adj) { avail[sz(b)].emplace_back(a); } // cerr << a.first << ' ' << a.second << '\t';for(auto x : b) cerr << x << ' '; cerr << '\n';
vector<pii> assoc(sz(edges));
auto get_top = [&]() {
for(int plane = 1; plane <= 4; plane++) {
while(avail[plane].size()) {
auto a = avail[plane].back();
avail[plane].pop_back();
if(adj.count(a) && !sz(adj[a]) == 0) return a;
}
}
assert(false);
};
for(int it = 0; it < sz(edges); it++) {
auto T = get_top();
//cerr << '\t' << T.first << ' ' << T.second << '\t';
int idx = *adj[T].begin();
//cerr << idx << '\n';
{
auto [x1, y1] = decr[edges[idx].first];
auto [x2, y2] = decr[edges[idx].second];
if(x1 == x2) {
auto _1 = make_pair(x1 - 1, max(y1, y2) - 1), _2 = make_pair(x1 + 1, max(y1, y2) - 1);
adj[_1].erase(idx);
adj[_2].erase(idx);
avail[sz(adj[_1])].emplace_back(_1);
avail[sz(adj[_2])].emplace_back(_2);
}
else {
assert(y1 == y2);
auto _1 = make_pair(max(x1, x2) - 1, y1 + 1), _2 = make_pair(max(x1, x2) - 1, y1 - 1);
adj[_1].erase(idx);
adj[_2].erase(idx);
avail[sz(adj[_1])].emplace_back(_1);
avail[sz(adj[_2])].emplace_back(_2);
}
}
adj.erase(T);
assoc[idx] = T;
}
auto [yi, er] = unravel(edges);
auto [san, si] = unravel(assoc);
build(yi, er, san, si);
return 1;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
4952 KB |
Output is correct |
2 |
Correct |
2 ms |
5140 KB |
Output is correct |
3 |
Correct |
2 ms |
4956 KB |
Output is correct |
4 |
Correct |
2 ms |
4956 KB |
Output is correct |
5 |
Correct |
4 ms |
4952 KB |
Output is correct |
6 |
Correct |
2 ms |
4956 KB |
Output is correct |
7 |
Correct |
3 ms |
4956 KB |
Output is correct |
8 |
Correct |
2 ms |
4956 KB |
Output is correct |
9 |
Correct |
496 ms |
91652 KB |
Output is correct |
10 |
Correct |
27 ms |
13656 KB |
Output is correct |
11 |
Correct |
233 ms |
52160 KB |
Output is correct |
12 |
Correct |
46 ms |
18044 KB |
Output is correct |
13 |
Correct |
55 ms |
16196 KB |
Output is correct |
14 |
Correct |
5 ms |
5212 KB |
Output is correct |
15 |
Correct |
4 ms |
5468 KB |
Output is correct |
16 |
Correct |
453 ms |
87808 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
4952 KB |
Output is correct |
2 |
Correct |
2 ms |
5140 KB |
Output is correct |
3 |
Correct |
2 ms |
4956 KB |
Output is correct |
4 |
Correct |
2 ms |
4956 KB |
Output is correct |
5 |
Correct |
4 ms |
4952 KB |
Output is correct |
6 |
Correct |
2 ms |
4956 KB |
Output is correct |
7 |
Correct |
3 ms |
4956 KB |
Output is correct |
8 |
Correct |
2 ms |
4956 KB |
Output is correct |
9 |
Correct |
496 ms |
91652 KB |
Output is correct |
10 |
Correct |
27 ms |
13656 KB |
Output is correct |
11 |
Correct |
233 ms |
52160 KB |
Output is correct |
12 |
Correct |
46 ms |
18044 KB |
Output is correct |
13 |
Correct |
55 ms |
16196 KB |
Output is correct |
14 |
Correct |
5 ms |
5212 KB |
Output is correct |
15 |
Correct |
4 ms |
5468 KB |
Output is correct |
16 |
Correct |
453 ms |
87808 KB |
Output is correct |
17 |
Correct |
2 ms |
4952 KB |
Output is correct |
18 |
Correct |
2 ms |
4952 KB |
Output is correct |
19 |
Correct |
2 ms |
5124 KB |
Output is correct |
20 |
Correct |
2 ms |
4956 KB |
Output is correct |
21 |
Correct |
2 ms |
4952 KB |
Output is correct |
22 |
Correct |
4 ms |
4956 KB |
Output is correct |
23 |
Correct |
1126 ms |
121544 KB |
Output is correct |
24 |
Correct |
2 ms |
4956 KB |
Output is correct |
25 |
Correct |
4 ms |
5724 KB |
Output is correct |
26 |
Correct |
4 ms |
5724 KB |
Output is correct |
27 |
Correct |
6 ms |
5724 KB |
Output is correct |
28 |
Correct |
346 ms |
52348 KB |
Output is correct |
29 |
Correct |
546 ms |
73416 KB |
Output is correct |
30 |
Correct |
747 ms |
99032 KB |
Output is correct |
31 |
Correct |
974 ms |
119852 KB |
Output is correct |
32 |
Correct |
2 ms |
4952 KB |
Output is correct |
33 |
Correct |
2 ms |
5076 KB |
Output is correct |
34 |
Correct |
2 ms |
4956 KB |
Output is correct |
35 |
Correct |
3 ms |
4956 KB |
Output is correct |
36 |
Correct |
2 ms |
5140 KB |
Output is correct |
37 |
Correct |
4 ms |
4956 KB |
Output is correct |
38 |
Correct |
2 ms |
5060 KB |
Output is correct |
39 |
Correct |
4 ms |
4956 KB |
Output is correct |
40 |
Correct |
2 ms |
4956 KB |
Output is correct |
41 |
Correct |
2 ms |
4956 KB |
Output is correct |
42 |
Correct |
4 ms |
4956 KB |
Output is correct |
43 |
Correct |
4 ms |
5468 KB |
Output is correct |
44 |
Correct |
5 ms |
5720 KB |
Output is correct |
45 |
Correct |
449 ms |
74692 KB |
Output is correct |
46 |
Correct |
792 ms |
106984 KB |
Output is correct |
47 |
Correct |
650 ms |
106164 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
4952 KB |
Output is correct |
2 |
Correct |
2 ms |
5140 KB |
Output is correct |
3 |
Correct |
2 ms |
4956 KB |
Output is correct |
4 |
Correct |
2 ms |
4956 KB |
Output is correct |
5 |
Correct |
4 ms |
4952 KB |
Output is correct |
6 |
Correct |
2 ms |
4956 KB |
Output is correct |
7 |
Correct |
3 ms |
4956 KB |
Output is correct |
8 |
Correct |
2 ms |
4956 KB |
Output is correct |
9 |
Correct |
496 ms |
91652 KB |
Output is correct |
10 |
Correct |
27 ms |
13656 KB |
Output is correct |
11 |
Correct |
233 ms |
52160 KB |
Output is correct |
12 |
Correct |
46 ms |
18044 KB |
Output is correct |
13 |
Correct |
55 ms |
16196 KB |
Output is correct |
14 |
Correct |
5 ms |
5212 KB |
Output is correct |
15 |
Correct |
4 ms |
5468 KB |
Output is correct |
16 |
Correct |
453 ms |
87808 KB |
Output is correct |
17 |
Correct |
2 ms |
4952 KB |
Output is correct |
18 |
Correct |
2 ms |
4952 KB |
Output is correct |
19 |
Correct |
2 ms |
5124 KB |
Output is correct |
20 |
Correct |
2 ms |
4956 KB |
Output is correct |
21 |
Correct |
2 ms |
4952 KB |
Output is correct |
22 |
Correct |
4 ms |
4956 KB |
Output is correct |
23 |
Correct |
1126 ms |
121544 KB |
Output is correct |
24 |
Correct |
2 ms |
4956 KB |
Output is correct |
25 |
Correct |
4 ms |
5724 KB |
Output is correct |
26 |
Correct |
4 ms |
5724 KB |
Output is correct |
27 |
Correct |
6 ms |
5724 KB |
Output is correct |
28 |
Correct |
346 ms |
52348 KB |
Output is correct |
29 |
Correct |
546 ms |
73416 KB |
Output is correct |
30 |
Correct |
747 ms |
99032 KB |
Output is correct |
31 |
Correct |
974 ms |
119852 KB |
Output is correct |
32 |
Correct |
2 ms |
4952 KB |
Output is correct |
33 |
Correct |
2 ms |
5076 KB |
Output is correct |
34 |
Correct |
2 ms |
4956 KB |
Output is correct |
35 |
Correct |
3 ms |
4956 KB |
Output is correct |
36 |
Correct |
2 ms |
5140 KB |
Output is correct |
37 |
Correct |
4 ms |
4956 KB |
Output is correct |
38 |
Correct |
2 ms |
5060 KB |
Output is correct |
39 |
Correct |
4 ms |
4956 KB |
Output is correct |
40 |
Correct |
2 ms |
4956 KB |
Output is correct |
41 |
Correct |
2 ms |
4956 KB |
Output is correct |
42 |
Correct |
4 ms |
4956 KB |
Output is correct |
43 |
Correct |
4 ms |
5468 KB |
Output is correct |
44 |
Correct |
5 ms |
5720 KB |
Output is correct |
45 |
Correct |
449 ms |
74692 KB |
Output is correct |
46 |
Correct |
792 ms |
106984 KB |
Output is correct |
47 |
Correct |
650 ms |
106164 KB |
Output is correct |
48 |
Correct |
2 ms |
4952 KB |
Output is correct |
49 |
Correct |
2 ms |
4956 KB |
Output is correct |
50 |
Correct |
2 ms |
4956 KB |
Output is correct |
51 |
Correct |
2 ms |
4956 KB |
Output is correct |
52 |
Correct |
2 ms |
5136 KB |
Output is correct |
53 |
Correct |
3 ms |
4956 KB |
Output is correct |
54 |
Correct |
2 ms |
4956 KB |
Output is correct |
55 |
Correct |
1047 ms |
119496 KB |
Output is correct |
56 |
Correct |
4 ms |
4952 KB |
Output is correct |
57 |
Correct |
6 ms |
5976 KB |
Output is correct |
58 |
Correct |
16 ms |
8540 KB |
Output is correct |
59 |
Correct |
13 ms |
7000 KB |
Output is correct |
60 |
Correct |
397 ms |
64456 KB |
Output is correct |
61 |
Correct |
575 ms |
85444 KB |
Output is correct |
62 |
Correct |
883 ms |
100348 KB |
Output is correct |
63 |
Correct |
1075 ms |
119064 KB |
Output is correct |
64 |
Correct |
3 ms |
5144 KB |
Output is correct |
65 |
Correct |
2 ms |
4956 KB |
Output is correct |
66 |
Correct |
2 ms |
4956 KB |
Output is correct |
67 |
Correct |
1246 ms |
174200 KB |
Output is correct |
68 |
Correct |
1315 ms |
174484 KB |
Output is correct |
69 |
Correct |
1227 ms |
175756 KB |
Output is correct |
70 |
Correct |
5 ms |
5920 KB |
Output is correct |
71 |
Correct |
13 ms |
6684 KB |
Output is correct |
72 |
Correct |
503 ms |
70304 KB |
Output is correct |
73 |
Correct |
791 ms |
105848 KB |
Output is correct |
74 |
Correct |
1055 ms |
136120 KB |
Output is correct |
75 |
Correct |
1136 ms |
148420 KB |
Output is correct |
76 |
Correct |
1187 ms |
179644 KB |
Output is correct |
77 |
Correct |
6 ms |
6232 KB |
Output is correct |
78 |
Correct |
16 ms |
7000 KB |
Output is correct |
79 |
Correct |
455 ms |
72776 KB |
Output is correct |
80 |
Correct |
799 ms |
107412 KB |
Output is correct |
81 |
Correct |
1183 ms |
142140 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
4952 KB |
Output is correct |
2 |
Correct |
2 ms |
5140 KB |
Output is correct |
3 |
Correct |
2 ms |
4956 KB |
Output is correct |
4 |
Correct |
2 ms |
4956 KB |
Output is correct |
5 |
Correct |
4 ms |
4952 KB |
Output is correct |
6 |
Correct |
2 ms |
4956 KB |
Output is correct |
7 |
Correct |
3 ms |
4956 KB |
Output is correct |
8 |
Correct |
2 ms |
4956 KB |
Output is correct |
9 |
Correct |
496 ms |
91652 KB |
Output is correct |
10 |
Correct |
27 ms |
13656 KB |
Output is correct |
11 |
Correct |
233 ms |
52160 KB |
Output is correct |
12 |
Correct |
46 ms |
18044 KB |
Output is correct |
13 |
Correct |
55 ms |
16196 KB |
Output is correct |
14 |
Correct |
5 ms |
5212 KB |
Output is correct |
15 |
Correct |
4 ms |
5468 KB |
Output is correct |
16 |
Correct |
453 ms |
87808 KB |
Output is correct |
17 |
Correct |
3 ms |
5208 KB |
Output is correct |
18 |
Correct |
2 ms |
4956 KB |
Output is correct |
19 |
Correct |
2 ms |
4956 KB |
Output is correct |
20 |
Correct |
904 ms |
122820 KB |
Output is correct |
21 |
Correct |
994 ms |
118732 KB |
Output is correct |
22 |
Correct |
1018 ms |
116628 KB |
Output is correct |
23 |
Correct |
1020 ms |
148124 KB |
Output is correct |
24 |
Correct |
280 ms |
35028 KB |
Output is correct |
25 |
Correct |
399 ms |
41660 KB |
Output is correct |
26 |
Correct |
335 ms |
41728 KB |
Output is correct |
27 |
Correct |
1131 ms |
160780 KB |
Output is correct |
28 |
Correct |
1163 ms |
160948 KB |
Output is correct |
29 |
Correct |
1471 ms |
161484 KB |
Output is correct |
30 |
Correct |
1342 ms |
160764 KB |
Output is correct |
31 |
Correct |
2 ms |
4952 KB |
Output is correct |
32 |
Correct |
54 ms |
14396 KB |
Output is correct |
33 |
Correct |
110 ms |
20304 KB |
Output is correct |
34 |
Correct |
830 ms |
119716 KB |
Output is correct |
35 |
Correct |
12 ms |
7000 KB |
Output is correct |
36 |
Correct |
74 ms |
14600 KB |
Output is correct |
37 |
Correct |
140 ms |
24004 KB |
Output is correct |
38 |
Correct |
385 ms |
53104 KB |
Output is correct |
39 |
Correct |
493 ms |
70856 KB |
Output is correct |
40 |
Correct |
701 ms |
88844 KB |
Output is correct |
41 |
Correct |
884 ms |
106436 KB |
Output is correct |
42 |
Correct |
1062 ms |
125140 KB |
Output is correct |
43 |
Correct |
3 ms |
4956 KB |
Output is correct |
44 |
Correct |
3 ms |
5136 KB |
Output is correct |
45 |
Correct |
4 ms |
4952 KB |
Output is correct |
46 |
Correct |
2 ms |
4956 KB |
Output is correct |
47 |
Correct |
2 ms |
4956 KB |
Output is correct |
48 |
Correct |
2 ms |
4956 KB |
Output is correct |
49 |
Correct |
3 ms |
5144 KB |
Output is correct |
50 |
Correct |
2 ms |
4956 KB |
Output is correct |
51 |
Correct |
2 ms |
5144 KB |
Output is correct |
52 |
Correct |
3 ms |
5132 KB |
Output is correct |
53 |
Correct |
3 ms |
4956 KB |
Output is correct |
54 |
Correct |
4 ms |
5468 KB |
Output is correct |
55 |
Correct |
8 ms |
5720 KB |
Output is correct |
56 |
Correct |
482 ms |
74724 KB |
Output is correct |
57 |
Correct |
753 ms |
106748 KB |
Output is correct |
58 |
Correct |
850 ms |
106200 KB |
Output is correct |
59 |
Correct |
3 ms |
4952 KB |
Output is correct |
60 |
Correct |
2 ms |
4956 KB |
Output is correct |
61 |
Correct |
2 ms |
4956 KB |
Output is correct |
62 |
Correct |
1266 ms |
174292 KB |
Output is correct |
63 |
Correct |
1233 ms |
174524 KB |
Output is correct |
64 |
Correct |
1146 ms |
175800 KB |
Output is correct |
65 |
Correct |
8 ms |
5980 KB |
Output is correct |
66 |
Correct |
9 ms |
6492 KB |
Output is correct |
67 |
Correct |
426 ms |
70356 KB |
Output is correct |
68 |
Correct |
793 ms |
105928 KB |
Output is correct |
69 |
Correct |
1111 ms |
136144 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
4952 KB |
Output is correct |
2 |
Correct |
2 ms |
5140 KB |
Output is correct |
3 |
Correct |
2 ms |
4956 KB |
Output is correct |
4 |
Correct |
2 ms |
4956 KB |
Output is correct |
5 |
Correct |
4 ms |
4952 KB |
Output is correct |
6 |
Correct |
2 ms |
4956 KB |
Output is correct |
7 |
Correct |
3 ms |
4956 KB |
Output is correct |
8 |
Correct |
2 ms |
4956 KB |
Output is correct |
9 |
Correct |
496 ms |
91652 KB |
Output is correct |
10 |
Correct |
27 ms |
13656 KB |
Output is correct |
11 |
Correct |
233 ms |
52160 KB |
Output is correct |
12 |
Correct |
46 ms |
18044 KB |
Output is correct |
13 |
Correct |
55 ms |
16196 KB |
Output is correct |
14 |
Correct |
5 ms |
5212 KB |
Output is correct |
15 |
Correct |
4 ms |
5468 KB |
Output is correct |
16 |
Correct |
453 ms |
87808 KB |
Output is correct |
17 |
Correct |
1191 ms |
179948 KB |
Output is correct |
18 |
Correct |
1087 ms |
178612 KB |
Output is correct |
19 |
Correct |
842 ms |
122860 KB |
Output is correct |
20 |
Correct |
1065 ms |
135284 KB |
Output is correct |
21 |
Correct |
998 ms |
140792 KB |
Output is correct |
22 |
Correct |
2 ms |
4952 KB |
Output is correct |
23 |
Correct |
114 ms |
25212 KB |
Output is correct |
24 |
Correct |
29 ms |
9564 KB |
Output is correct |
25 |
Correct |
88 ms |
18768 KB |
Output is correct |
26 |
Correct |
173 ms |
28244 KB |
Output is correct |
27 |
Correct |
463 ms |
70940 KB |
Output is correct |
28 |
Correct |
654 ms |
87548 KB |
Output is correct |
29 |
Correct |
760 ms |
106312 KB |
Output is correct |
30 |
Correct |
931 ms |
120472 KB |
Output is correct |
31 |
Correct |
1081 ms |
137308 KB |
Output is correct |
32 |
Correct |
1152 ms |
148616 KB |
Output is correct |
33 |
Correct |
1202 ms |
179584 KB |
Output is correct |
34 |
Correct |
9 ms |
6232 KB |
Output is correct |
35 |
Correct |
12 ms |
7024 KB |
Output is correct |
36 |
Correct |
452 ms |
72944 KB |
Output is correct |
37 |
Correct |
817 ms |
107444 KB |
Output is correct |
38 |
Correct |
1109 ms |
142148 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
4952 KB |
Output is correct |
2 |
Correct |
2 ms |
5140 KB |
Output is correct |
3 |
Correct |
2 ms |
4956 KB |
Output is correct |
4 |
Correct |
2 ms |
4956 KB |
Output is correct |
5 |
Correct |
4 ms |
4952 KB |
Output is correct |
6 |
Correct |
2 ms |
4956 KB |
Output is correct |
7 |
Correct |
3 ms |
4956 KB |
Output is correct |
8 |
Correct |
2 ms |
4956 KB |
Output is correct |
9 |
Correct |
496 ms |
91652 KB |
Output is correct |
10 |
Correct |
27 ms |
13656 KB |
Output is correct |
11 |
Correct |
233 ms |
52160 KB |
Output is correct |
12 |
Correct |
46 ms |
18044 KB |
Output is correct |
13 |
Correct |
55 ms |
16196 KB |
Output is correct |
14 |
Correct |
5 ms |
5212 KB |
Output is correct |
15 |
Correct |
4 ms |
5468 KB |
Output is correct |
16 |
Correct |
453 ms |
87808 KB |
Output is correct |
17 |
Correct |
2 ms |
4952 KB |
Output is correct |
18 |
Correct |
2 ms |
4952 KB |
Output is correct |
19 |
Correct |
2 ms |
5124 KB |
Output is correct |
20 |
Correct |
2 ms |
4956 KB |
Output is correct |
21 |
Correct |
2 ms |
4952 KB |
Output is correct |
22 |
Correct |
4 ms |
4956 KB |
Output is correct |
23 |
Correct |
1126 ms |
121544 KB |
Output is correct |
24 |
Correct |
2 ms |
4956 KB |
Output is correct |
25 |
Correct |
4 ms |
5724 KB |
Output is correct |
26 |
Correct |
4 ms |
5724 KB |
Output is correct |
27 |
Correct |
6 ms |
5724 KB |
Output is correct |
28 |
Correct |
346 ms |
52348 KB |
Output is correct |
29 |
Correct |
546 ms |
73416 KB |
Output is correct |
30 |
Correct |
747 ms |
99032 KB |
Output is correct |
31 |
Correct |
974 ms |
119852 KB |
Output is correct |
32 |
Correct |
2 ms |
4952 KB |
Output is correct |
33 |
Correct |
2 ms |
5076 KB |
Output is correct |
34 |
Correct |
2 ms |
4956 KB |
Output is correct |
35 |
Correct |
3 ms |
4956 KB |
Output is correct |
36 |
Correct |
2 ms |
5140 KB |
Output is correct |
37 |
Correct |
4 ms |
4956 KB |
Output is correct |
38 |
Correct |
2 ms |
5060 KB |
Output is correct |
39 |
Correct |
4 ms |
4956 KB |
Output is correct |
40 |
Correct |
2 ms |
4956 KB |
Output is correct |
41 |
Correct |
2 ms |
4956 KB |
Output is correct |
42 |
Correct |
4 ms |
4956 KB |
Output is correct |
43 |
Correct |
4 ms |
5468 KB |
Output is correct |
44 |
Correct |
5 ms |
5720 KB |
Output is correct |
45 |
Correct |
449 ms |
74692 KB |
Output is correct |
46 |
Correct |
792 ms |
106984 KB |
Output is correct |
47 |
Correct |
650 ms |
106164 KB |
Output is correct |
48 |
Correct |
2 ms |
4952 KB |
Output is correct |
49 |
Correct |
2 ms |
4956 KB |
Output is correct |
50 |
Correct |
2 ms |
4956 KB |
Output is correct |
51 |
Correct |
2 ms |
4956 KB |
Output is correct |
52 |
Correct |
2 ms |
5136 KB |
Output is correct |
53 |
Correct |
3 ms |
4956 KB |
Output is correct |
54 |
Correct |
2 ms |
4956 KB |
Output is correct |
55 |
Correct |
1047 ms |
119496 KB |
Output is correct |
56 |
Correct |
4 ms |
4952 KB |
Output is correct |
57 |
Correct |
6 ms |
5976 KB |
Output is correct |
58 |
Correct |
16 ms |
8540 KB |
Output is correct |
59 |
Correct |
13 ms |
7000 KB |
Output is correct |
60 |
Correct |
397 ms |
64456 KB |
Output is correct |
61 |
Correct |
575 ms |
85444 KB |
Output is correct |
62 |
Correct |
883 ms |
100348 KB |
Output is correct |
63 |
Correct |
1075 ms |
119064 KB |
Output is correct |
64 |
Correct |
3 ms |
5144 KB |
Output is correct |
65 |
Correct |
2 ms |
4956 KB |
Output is correct |
66 |
Correct |
2 ms |
4956 KB |
Output is correct |
67 |
Correct |
1246 ms |
174200 KB |
Output is correct |
68 |
Correct |
1315 ms |
174484 KB |
Output is correct |
69 |
Correct |
1227 ms |
175756 KB |
Output is correct |
70 |
Correct |
5 ms |
5920 KB |
Output is correct |
71 |
Correct |
13 ms |
6684 KB |
Output is correct |
72 |
Correct |
503 ms |
70304 KB |
Output is correct |
73 |
Correct |
791 ms |
105848 KB |
Output is correct |
74 |
Correct |
1055 ms |
136120 KB |
Output is correct |
75 |
Correct |
1136 ms |
148420 KB |
Output is correct |
76 |
Correct |
1187 ms |
179644 KB |
Output is correct |
77 |
Correct |
6 ms |
6232 KB |
Output is correct |
78 |
Correct |
16 ms |
7000 KB |
Output is correct |
79 |
Correct |
455 ms |
72776 KB |
Output is correct |
80 |
Correct |
799 ms |
107412 KB |
Output is correct |
81 |
Correct |
1183 ms |
142140 KB |
Output is correct |
82 |
Correct |
3 ms |
5208 KB |
Output is correct |
83 |
Correct |
2 ms |
4956 KB |
Output is correct |
84 |
Correct |
2 ms |
4956 KB |
Output is correct |
85 |
Correct |
904 ms |
122820 KB |
Output is correct |
86 |
Correct |
994 ms |
118732 KB |
Output is correct |
87 |
Correct |
1018 ms |
116628 KB |
Output is correct |
88 |
Correct |
1020 ms |
148124 KB |
Output is correct |
89 |
Correct |
280 ms |
35028 KB |
Output is correct |
90 |
Correct |
399 ms |
41660 KB |
Output is correct |
91 |
Correct |
335 ms |
41728 KB |
Output is correct |
92 |
Correct |
1131 ms |
160780 KB |
Output is correct |
93 |
Correct |
1163 ms |
160948 KB |
Output is correct |
94 |
Correct |
1471 ms |
161484 KB |
Output is correct |
95 |
Correct |
1342 ms |
160764 KB |
Output is correct |
96 |
Correct |
2 ms |
4952 KB |
Output is correct |
97 |
Correct |
54 ms |
14396 KB |
Output is correct |
98 |
Correct |
110 ms |
20304 KB |
Output is correct |
99 |
Correct |
830 ms |
119716 KB |
Output is correct |
100 |
Correct |
12 ms |
7000 KB |
Output is correct |
101 |
Correct |
74 ms |
14600 KB |
Output is correct |
102 |
Correct |
140 ms |
24004 KB |
Output is correct |
103 |
Correct |
385 ms |
53104 KB |
Output is correct |
104 |
Correct |
493 ms |
70856 KB |
Output is correct |
105 |
Correct |
701 ms |
88844 KB |
Output is correct |
106 |
Correct |
884 ms |
106436 KB |
Output is correct |
107 |
Correct |
1062 ms |
125140 KB |
Output is correct |
108 |
Correct |
3 ms |
4956 KB |
Output is correct |
109 |
Correct |
3 ms |
5136 KB |
Output is correct |
110 |
Correct |
4 ms |
4952 KB |
Output is correct |
111 |
Correct |
2 ms |
4956 KB |
Output is correct |
112 |
Correct |
2 ms |
4956 KB |
Output is correct |
113 |
Correct |
2 ms |
4956 KB |
Output is correct |
114 |
Correct |
3 ms |
5144 KB |
Output is correct |
115 |
Correct |
2 ms |
4956 KB |
Output is correct |
116 |
Correct |
2 ms |
5144 KB |
Output is correct |
117 |
Correct |
3 ms |
5132 KB |
Output is correct |
118 |
Correct |
3 ms |
4956 KB |
Output is correct |
119 |
Correct |
4 ms |
5468 KB |
Output is correct |
120 |
Correct |
8 ms |
5720 KB |
Output is correct |
121 |
Correct |
482 ms |
74724 KB |
Output is correct |
122 |
Correct |
753 ms |
106748 KB |
Output is correct |
123 |
Correct |
850 ms |
106200 KB |
Output is correct |
124 |
Correct |
3 ms |
4952 KB |
Output is correct |
125 |
Correct |
2 ms |
4956 KB |
Output is correct |
126 |
Correct |
2 ms |
4956 KB |
Output is correct |
127 |
Correct |
1266 ms |
174292 KB |
Output is correct |
128 |
Correct |
1233 ms |
174524 KB |
Output is correct |
129 |
Correct |
1146 ms |
175800 KB |
Output is correct |
130 |
Correct |
8 ms |
5980 KB |
Output is correct |
131 |
Correct |
9 ms |
6492 KB |
Output is correct |
132 |
Correct |
426 ms |
70356 KB |
Output is correct |
133 |
Correct |
793 ms |
105928 KB |
Output is correct |
134 |
Correct |
1111 ms |
136144 KB |
Output is correct |
135 |
Correct |
1191 ms |
179948 KB |
Output is correct |
136 |
Correct |
1087 ms |
178612 KB |
Output is correct |
137 |
Correct |
842 ms |
122860 KB |
Output is correct |
138 |
Correct |
1065 ms |
135284 KB |
Output is correct |
139 |
Correct |
998 ms |
140792 KB |
Output is correct |
140 |
Correct |
2 ms |
4952 KB |
Output is correct |
141 |
Correct |
114 ms |
25212 KB |
Output is correct |
142 |
Correct |
29 ms |
9564 KB |
Output is correct |
143 |
Correct |
88 ms |
18768 KB |
Output is correct |
144 |
Correct |
173 ms |
28244 KB |
Output is correct |
145 |
Correct |
463 ms |
70940 KB |
Output is correct |
146 |
Correct |
654 ms |
87548 KB |
Output is correct |
147 |
Correct |
760 ms |
106312 KB |
Output is correct |
148 |
Correct |
931 ms |
120472 KB |
Output is correct |
149 |
Correct |
1081 ms |
137308 KB |
Output is correct |
150 |
Correct |
1152 ms |
148616 KB |
Output is correct |
151 |
Correct |
1202 ms |
179584 KB |
Output is correct |
152 |
Correct |
9 ms |
6232 KB |
Output is correct |
153 |
Correct |
12 ms |
7024 KB |
Output is correct |
154 |
Correct |
452 ms |
72944 KB |
Output is correct |
155 |
Correct |
817 ms |
107444 KB |
Output is correct |
156 |
Correct |
1109 ms |
142148 KB |
Output is correct |
157 |
Correct |
3 ms |
4952 KB |
Output is correct |
158 |
Correct |
2 ms |
4952 KB |
Output is correct |
159 |
Correct |
2 ms |
5032 KB |
Output is correct |
160 |
Correct |
2 ms |
4956 KB |
Output is correct |
161 |
Correct |
1034 ms |
118056 KB |
Output is correct |
162 |
Correct |
803 ms |
116964 KB |
Output is correct |
163 |
Correct |
783 ms |
113136 KB |
Output is correct |
164 |
Correct |
864 ms |
112372 KB |
Output is correct |
165 |
Correct |
967 ms |
122388 KB |
Output is correct |
166 |
Correct |
1043 ms |
123332 KB |
Output is correct |
167 |
Runtime error |
194 ms |
60776 KB |
Execution killed with signal 6 |
168 |
Halted |
0 ms |
0 KB |
- |