#include "parks.h"
#include <iostream>
#include <map>
#include <array>
#include <queue>
#define ll long long
using namespace std;
map <array<ll, 2>, ll> mp;
map <array<ll, 2>, ll> visited;
map <array<ll, 2>, ll> pt;
map <array<ll, 3>, ll> edge;
queue <array<ll, 2>> Q;
vector <int> U, V, A, B;
ll dj[4][2] = {-1, -1, -1, 1, 1, 1, 1, -1}, dk[4][2] = {-2, 0, 0, 2, 2, 0, 0, -2};
void dfs(ll u, ll v) {
++visited[{u, v}];
for (int i=0; i<4; ++i) {
ll nx = u + dk[i][0], ny = v + dk[i][1];
if (pt.count({nx, ny}) && !visited.count({nx, ny})) dfs(nx, ny);
}
}
void solve(ll u, ll v) {
for (int i=0; i<4; ++i) {
if (edge.count({u, v, i})) {
if (visited.count({u, v})) break;
++visited[{u, v}];
U.push_back(pt[{u + dj[i][0], v + dj[i][1]}]);
V.push_back(pt[{u + dj[(i+1)%4][0], v + dj[(i+1)%4][1]}]);
A.push_back(u);
B.push_back(v);
edge.erase({u, v, i});
edge.erase({u + dk[i][0], v + dk[i][1], i ^ 2});
solve(u + dk[i][0], v + dk[i][1]);
break;
}
}
}
int construct_roads(std::vector<int> x, std::vector<int> y) {
ll n = x.size();
for (int i=0; i<n; ++i) {
pt[{x[i], y[i]}] = i;
for (int j=0; j<4; ++j) {
ll nx = x[i] + dj[j][0], ny = y[i] + dj[j][1];
++mp[{nx, ny}];
}
}
dfs(x[0], y[0]);
if (visited.size() != pt.size()) return 0;
for (auto it = mp.begin(); it != mp.end();) {
auto nx = next(it);
auto [u, v] = it->first;
ll tot = 0;
for (int i=0; i<4; ++i) {
if (pt.count({u + dj[i][0], v + dj[i][1]}) && pt.count({u + dj[(i+1)%4][0], v + dj[(i+1)%4][1]})) {
++tot;
++edge[{u, v, i}];
}
}
mp[{u, v}] = tot;
if (tot == 0) mp.erase(it);
else if (tot == 1) Q.push({u, v});
it = nx;
}
while (!Q.empty()) {
auto [u, v] = Q.front();
Q.pop();
if (!mp.count({u, v})) continue;
for (int i=0; i<4; ++i) {
if (edge.count({u, v, i})) {
U.push_back(pt[{u + dj[i][0], v + dj[i][1]}]);
V.push_back(pt[{u + dj[(i+1)%4][0], v + dj[(i+1)%4][1]}]);
edge.erase({u, v, i});
edge.erase({u + dk[i][0], v + dk[i][1], i ^ 2});
--mp[{u + dk[i][0], v + dk[i][1]}];
if (mp[{u + dk[i][0], v + dk[i][1]}] == 1) Q.push({u + dk[i][0], v + dk[i][1]});
else if (mp[{u + dk[i][0], v + dk[i][1]}] == 0) mp.erase({u + dk[i][0], v + dk[i][1]});
}
}
mp.erase({u, v});
A.push_back(u);
B.push_back(v);
}
for (auto [y, z] : mp) {
auto [u, v] = y;
if (z == 4) Q.push({u, v});
}
ll s = 0;
for (auto [y, z] : mp) {
if (z == 4) ++s;
else if (z == 3) --s;
}
if (s > 0) return 0;
for (auto [y, z] : mp) {
auto [u, v] = y;
if (z == 4) {
for (int i=0; i<4; ++i) {
if (edge.count({u, v, i})) {
edge.erase({u, v, i});
edge.erase({u + dk[i][0], v + dk[i][1], i ^ 2});
--mp[{u, v}];
break;
}
}
}
}
visited.clear();
for (auto [y, z] : mp) {
auto [u, v] = y;
solve(u, v);
}
build(U, V, A, B);
return 1;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 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 |
344 KB |
Output is correct |
5 |
Correct |
0 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 |
468 ms |
61360 KB |
Output is correct |
10 |
Correct |
38 ms |
6484 KB |
Output is correct |
11 |
Correct |
248 ms |
33748 KB |
Output is correct |
12 |
Correct |
55 ms |
9556 KB |
Output is correct |
13 |
Correct |
61 ms |
15752 KB |
Output is correct |
14 |
Correct |
1 ms |
852 KB |
Output is correct |
15 |
Correct |
2 ms |
860 KB |
Output is correct |
16 |
Correct |
451 ms |
55680 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 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 |
344 KB |
Output is correct |
5 |
Correct |
0 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 |
468 ms |
61360 KB |
Output is correct |
10 |
Correct |
38 ms |
6484 KB |
Output is correct |
11 |
Correct |
248 ms |
33748 KB |
Output is correct |
12 |
Correct |
55 ms |
9556 KB |
Output is correct |
13 |
Correct |
61 ms |
15752 KB |
Output is correct |
14 |
Correct |
1 ms |
852 KB |
Output is correct |
15 |
Correct |
2 ms |
860 KB |
Output is correct |
16 |
Correct |
451 ms |
55680 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 |
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 |
1214 ms |
131424 KB |
Output is correct |
24 |
Correct |
0 ms |
348 KB |
Output is correct |
25 |
Correct |
4 ms |
1172 KB |
Output is correct |
26 |
Correct |
3 ms |
1212 KB |
Output is correct |
27 |
Correct |
5 ms |
1216 KB |
Output is correct |
28 |
Correct |
414 ms |
54300 KB |
Output is correct |
29 |
Correct |
704 ms |
81488 KB |
Output is correct |
30 |
Correct |
1033 ms |
111532 KB |
Output is correct |
31 |
Correct |
1309 ms |
128760 KB |
Output is correct |
32 |
Correct |
1 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 |
1 ms |
348 KB |
Output is correct |
41 |
Correct |
1 ms |
348 KB |
Output is correct |
42 |
Correct |
0 ms |
348 KB |
Output is correct |
43 |
Correct |
2 ms |
860 KB |
Output is correct |
44 |
Correct |
3 ms |
1064 KB |
Output is correct |
45 |
Correct |
514 ms |
54896 KB |
Output is correct |
46 |
Correct |
816 ms |
81136 KB |
Output is correct |
47 |
Correct |
813 ms |
79536 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 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 |
344 KB |
Output is correct |
5 |
Correct |
0 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 |
468 ms |
61360 KB |
Output is correct |
10 |
Correct |
38 ms |
6484 KB |
Output is correct |
11 |
Correct |
248 ms |
33748 KB |
Output is correct |
12 |
Correct |
55 ms |
9556 KB |
Output is correct |
13 |
Correct |
61 ms |
15752 KB |
Output is correct |
14 |
Correct |
1 ms |
852 KB |
Output is correct |
15 |
Correct |
2 ms |
860 KB |
Output is correct |
16 |
Correct |
451 ms |
55680 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 |
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 |
1214 ms |
131424 KB |
Output is correct |
24 |
Correct |
0 ms |
348 KB |
Output is correct |
25 |
Correct |
4 ms |
1172 KB |
Output is correct |
26 |
Correct |
3 ms |
1212 KB |
Output is correct |
27 |
Correct |
5 ms |
1216 KB |
Output is correct |
28 |
Correct |
414 ms |
54300 KB |
Output is correct |
29 |
Correct |
704 ms |
81488 KB |
Output is correct |
30 |
Correct |
1033 ms |
111532 KB |
Output is correct |
31 |
Correct |
1309 ms |
128760 KB |
Output is correct |
32 |
Correct |
1 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 |
1 ms |
348 KB |
Output is correct |
41 |
Correct |
1 ms |
348 KB |
Output is correct |
42 |
Correct |
0 ms |
348 KB |
Output is correct |
43 |
Correct |
2 ms |
860 KB |
Output is correct |
44 |
Correct |
3 ms |
1064 KB |
Output is correct |
45 |
Correct |
514 ms |
54896 KB |
Output is correct |
46 |
Correct |
816 ms |
81136 KB |
Output is correct |
47 |
Correct |
813 ms |
79536 KB |
Output is correct |
48 |
Correct |
1 ms |
348 KB |
Output is correct |
49 |
Correct |
0 ms |
348 KB |
Output is correct |
50 |
Correct |
1 ms |
348 KB |
Output is correct |
51 |
Correct |
0 ms |
348 KB |
Output is correct |
52 |
Correct |
0 ms |
440 KB |
Output is correct |
53 |
Correct |
0 ms |
344 KB |
Output is correct |
54 |
Correct |
0 ms |
348 KB |
Output is correct |
55 |
Correct |
1305 ms |
132680 KB |
Output is correct |
56 |
Correct |
0 ms |
344 KB |
Output is correct |
57 |
Correct |
6 ms |
1372 KB |
Output is correct |
58 |
Correct |
31 ms |
4308 KB |
Output is correct |
59 |
Correct |
15 ms |
2396 KB |
Output is correct |
60 |
Correct |
558 ms |
66776 KB |
Output is correct |
61 |
Correct |
817 ms |
91300 KB |
Output is correct |
62 |
Correct |
1114 ms |
109684 KB |
Output is correct |
63 |
Correct |
1379 ms |
131844 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 |
1042 ms |
118036 KB |
Output is correct |
68 |
Correct |
1064 ms |
118540 KB |
Output is correct |
69 |
Correct |
1053 ms |
120344 KB |
Output is correct |
70 |
Correct |
5 ms |
1372 KB |
Output is correct |
71 |
Correct |
8 ms |
2348 KB |
Output is correct |
72 |
Correct |
499 ms |
50356 KB |
Output is correct |
73 |
Correct |
890 ms |
79288 KB |
Output is correct |
74 |
Correct |
1168 ms |
104256 KB |
Output is correct |
75 |
Correct |
1103 ms |
121604 KB |
Output is correct |
76 |
Correct |
987 ms |
126224 KB |
Output is correct |
77 |
Correct |
10 ms |
1624 KB |
Output is correct |
78 |
Correct |
11 ms |
2652 KB |
Output is correct |
79 |
Correct |
533 ms |
54464 KB |
Output is correct |
80 |
Correct |
875 ms |
84160 KB |
Output is correct |
81 |
Correct |
1281 ms |
110760 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 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 |
344 KB |
Output is correct |
5 |
Correct |
0 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 |
468 ms |
61360 KB |
Output is correct |
10 |
Correct |
38 ms |
6484 KB |
Output is correct |
11 |
Correct |
248 ms |
33748 KB |
Output is correct |
12 |
Correct |
55 ms |
9556 KB |
Output is correct |
13 |
Correct |
61 ms |
15752 KB |
Output is correct |
14 |
Correct |
1 ms |
852 KB |
Output is correct |
15 |
Correct |
2 ms |
860 KB |
Output is correct |
16 |
Correct |
451 ms |
55680 KB |
Output is correct |
17 |
Correct |
1 ms |
348 KB |
Output is correct |
18 |
Correct |
0 ms |
432 KB |
Output is correct |
19 |
Correct |
0 ms |
348 KB |
Output is correct |
20 |
Correct |
1042 ms |
120956 KB |
Output is correct |
21 |
Correct |
1078 ms |
114960 KB |
Output is correct |
22 |
Correct |
1069 ms |
111884 KB |
Output is correct |
23 |
Correct |
778 ms |
99452 KB |
Output is correct |
24 |
Correct |
369 ms |
67716 KB |
Output is correct |
25 |
Correct |
340 ms |
42836 KB |
Output is correct |
26 |
Correct |
320 ms |
42836 KB |
Output is correct |
27 |
Correct |
1004 ms |
99136 KB |
Output is correct |
28 |
Correct |
1045 ms |
99164 KB |
Output is correct |
29 |
Correct |
1196 ms |
98320 KB |
Output is correct |
30 |
Correct |
1195 ms |
98552 KB |
Output is correct |
31 |
Correct |
0 ms |
348 KB |
Output is correct |
32 |
Correct |
61 ms |
7896 KB |
Output is correct |
33 |
Correct |
155 ms |
28296 KB |
Output is correct |
34 |
Correct |
1016 ms |
116256 KB |
Output is correct |
35 |
Correct |
14 ms |
2652 KB |
Output is correct |
36 |
Correct |
66 ms |
10872 KB |
Output is correct |
37 |
Correct |
146 ms |
20660 KB |
Output is correct |
38 |
Correct |
395 ms |
36420 KB |
Output is correct |
39 |
Correct |
579 ms |
49580 KB |
Output is correct |
40 |
Correct |
752 ms |
62164 KB |
Output is correct |
41 |
Correct |
952 ms |
76392 KB |
Output is correct |
42 |
Correct |
1243 ms |
90980 KB |
Output is correct |
43 |
Correct |
0 ms |
348 KB |
Output is correct |
44 |
Correct |
0 ms |
348 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 |
348 KB |
Output is correct |
48 |
Correct |
0 ms |
600 KB |
Output is correct |
49 |
Correct |
0 ms |
348 KB |
Output is correct |
50 |
Correct |
1 ms |
348 KB |
Output is correct |
51 |
Correct |
0 ms |
408 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 |
856 KB |
Output is correct |
55 |
Correct |
3 ms |
1116 KB |
Output is correct |
56 |
Correct |
500 ms |
54904 KB |
Output is correct |
57 |
Correct |
814 ms |
81072 KB |
Output is correct |
58 |
Correct |
815 ms |
79532 KB |
Output is correct |
59 |
Correct |
0 ms |
344 KB |
Output is correct |
60 |
Correct |
0 ms |
344 KB |
Output is correct |
61 |
Correct |
0 ms |
348 KB |
Output is correct |
62 |
Correct |
1081 ms |
118132 KB |
Output is correct |
63 |
Correct |
1033 ms |
118708 KB |
Output is correct |
64 |
Correct |
977 ms |
120340 KB |
Output is correct |
65 |
Correct |
5 ms |
1368 KB |
Output is correct |
66 |
Correct |
8 ms |
2096 KB |
Output is correct |
67 |
Correct |
496 ms |
50284 KB |
Output is correct |
68 |
Correct |
871 ms |
79348 KB |
Output is correct |
69 |
Correct |
1240 ms |
104364 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 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 |
344 KB |
Output is correct |
5 |
Correct |
0 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 |
468 ms |
61360 KB |
Output is correct |
10 |
Correct |
38 ms |
6484 KB |
Output is correct |
11 |
Correct |
248 ms |
33748 KB |
Output is correct |
12 |
Correct |
55 ms |
9556 KB |
Output is correct |
13 |
Correct |
61 ms |
15752 KB |
Output is correct |
14 |
Correct |
1 ms |
852 KB |
Output is correct |
15 |
Correct |
2 ms |
860 KB |
Output is correct |
16 |
Correct |
451 ms |
55680 KB |
Output is correct |
17 |
Correct |
1029 ms |
126996 KB |
Output is correct |
18 |
Correct |
1079 ms |
123936 KB |
Output is correct |
19 |
Correct |
1049 ms |
118832 KB |
Output is correct |
20 |
Correct |
1212 ms |
117940 KB |
Output is correct |
21 |
Correct |
1066 ms |
99996 KB |
Output is correct |
22 |
Correct |
1 ms |
348 KB |
Output is correct |
23 |
Correct |
140 ms |
15800 KB |
Output is correct |
24 |
Correct |
39 ms |
5356 KB |
Output is correct |
25 |
Correct |
93 ms |
14932 KB |
Output is correct |
26 |
Correct |
190 ms |
24196 KB |
Output is correct |
27 |
Correct |
629 ms |
56488 KB |
Output is correct |
28 |
Correct |
805 ms |
69568 KB |
Output is correct |
29 |
Correct |
936 ms |
84888 KB |
Output is correct |
30 |
Correct |
1120 ms |
98212 KB |
Output is correct |
31 |
Correct |
1490 ms |
112648 KB |
Output is correct |
32 |
Correct |
1162 ms |
121492 KB |
Output is correct |
33 |
Correct |
1052 ms |
126220 KB |
Output is correct |
34 |
Correct |
7 ms |
1628 KB |
Output is correct |
35 |
Correct |
10 ms |
2652 KB |
Output is correct |
36 |
Correct |
515 ms |
54484 KB |
Output is correct |
37 |
Correct |
897 ms |
84244 KB |
Output is correct |
38 |
Correct |
1225 ms |
110768 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 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 |
344 KB |
Output is correct |
5 |
Correct |
0 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 |
468 ms |
61360 KB |
Output is correct |
10 |
Correct |
38 ms |
6484 KB |
Output is correct |
11 |
Correct |
248 ms |
33748 KB |
Output is correct |
12 |
Correct |
55 ms |
9556 KB |
Output is correct |
13 |
Correct |
61 ms |
15752 KB |
Output is correct |
14 |
Correct |
1 ms |
852 KB |
Output is correct |
15 |
Correct |
2 ms |
860 KB |
Output is correct |
16 |
Correct |
451 ms |
55680 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 |
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 |
1214 ms |
131424 KB |
Output is correct |
24 |
Correct |
0 ms |
348 KB |
Output is correct |
25 |
Correct |
4 ms |
1172 KB |
Output is correct |
26 |
Correct |
3 ms |
1212 KB |
Output is correct |
27 |
Correct |
5 ms |
1216 KB |
Output is correct |
28 |
Correct |
414 ms |
54300 KB |
Output is correct |
29 |
Correct |
704 ms |
81488 KB |
Output is correct |
30 |
Correct |
1033 ms |
111532 KB |
Output is correct |
31 |
Correct |
1309 ms |
128760 KB |
Output is correct |
32 |
Correct |
1 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 |
1 ms |
348 KB |
Output is correct |
41 |
Correct |
1 ms |
348 KB |
Output is correct |
42 |
Correct |
0 ms |
348 KB |
Output is correct |
43 |
Correct |
2 ms |
860 KB |
Output is correct |
44 |
Correct |
3 ms |
1064 KB |
Output is correct |
45 |
Correct |
514 ms |
54896 KB |
Output is correct |
46 |
Correct |
816 ms |
81136 KB |
Output is correct |
47 |
Correct |
813 ms |
79536 KB |
Output is correct |
48 |
Correct |
1 ms |
348 KB |
Output is correct |
49 |
Correct |
0 ms |
348 KB |
Output is correct |
50 |
Correct |
1 ms |
348 KB |
Output is correct |
51 |
Correct |
0 ms |
348 KB |
Output is correct |
52 |
Correct |
0 ms |
440 KB |
Output is correct |
53 |
Correct |
0 ms |
344 KB |
Output is correct |
54 |
Correct |
0 ms |
348 KB |
Output is correct |
55 |
Correct |
1305 ms |
132680 KB |
Output is correct |
56 |
Correct |
0 ms |
344 KB |
Output is correct |
57 |
Correct |
6 ms |
1372 KB |
Output is correct |
58 |
Correct |
31 ms |
4308 KB |
Output is correct |
59 |
Correct |
15 ms |
2396 KB |
Output is correct |
60 |
Correct |
558 ms |
66776 KB |
Output is correct |
61 |
Correct |
817 ms |
91300 KB |
Output is correct |
62 |
Correct |
1114 ms |
109684 KB |
Output is correct |
63 |
Correct |
1379 ms |
131844 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 |
1042 ms |
118036 KB |
Output is correct |
68 |
Correct |
1064 ms |
118540 KB |
Output is correct |
69 |
Correct |
1053 ms |
120344 KB |
Output is correct |
70 |
Correct |
5 ms |
1372 KB |
Output is correct |
71 |
Correct |
8 ms |
2348 KB |
Output is correct |
72 |
Correct |
499 ms |
50356 KB |
Output is correct |
73 |
Correct |
890 ms |
79288 KB |
Output is correct |
74 |
Correct |
1168 ms |
104256 KB |
Output is correct |
75 |
Correct |
1103 ms |
121604 KB |
Output is correct |
76 |
Correct |
987 ms |
126224 KB |
Output is correct |
77 |
Correct |
10 ms |
1624 KB |
Output is correct |
78 |
Correct |
11 ms |
2652 KB |
Output is correct |
79 |
Correct |
533 ms |
54464 KB |
Output is correct |
80 |
Correct |
875 ms |
84160 KB |
Output is correct |
81 |
Correct |
1281 ms |
110760 KB |
Output is correct |
82 |
Correct |
1 ms |
348 KB |
Output is correct |
83 |
Correct |
0 ms |
432 KB |
Output is correct |
84 |
Correct |
0 ms |
348 KB |
Output is correct |
85 |
Correct |
1042 ms |
120956 KB |
Output is correct |
86 |
Correct |
1078 ms |
114960 KB |
Output is correct |
87 |
Correct |
1069 ms |
111884 KB |
Output is correct |
88 |
Correct |
778 ms |
99452 KB |
Output is correct |
89 |
Correct |
369 ms |
67716 KB |
Output is correct |
90 |
Correct |
340 ms |
42836 KB |
Output is correct |
91 |
Correct |
320 ms |
42836 KB |
Output is correct |
92 |
Correct |
1004 ms |
99136 KB |
Output is correct |
93 |
Correct |
1045 ms |
99164 KB |
Output is correct |
94 |
Correct |
1196 ms |
98320 KB |
Output is correct |
95 |
Correct |
1195 ms |
98552 KB |
Output is correct |
96 |
Correct |
0 ms |
348 KB |
Output is correct |
97 |
Correct |
61 ms |
7896 KB |
Output is correct |
98 |
Correct |
155 ms |
28296 KB |
Output is correct |
99 |
Correct |
1016 ms |
116256 KB |
Output is correct |
100 |
Correct |
14 ms |
2652 KB |
Output is correct |
101 |
Correct |
66 ms |
10872 KB |
Output is correct |
102 |
Correct |
146 ms |
20660 KB |
Output is correct |
103 |
Correct |
395 ms |
36420 KB |
Output is correct |
104 |
Correct |
579 ms |
49580 KB |
Output is correct |
105 |
Correct |
752 ms |
62164 KB |
Output is correct |
106 |
Correct |
952 ms |
76392 KB |
Output is correct |
107 |
Correct |
1243 ms |
90980 KB |
Output is correct |
108 |
Correct |
0 ms |
348 KB |
Output is correct |
109 |
Correct |
0 ms |
348 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 |
348 KB |
Output is correct |
113 |
Correct |
0 ms |
600 KB |
Output is correct |
114 |
Correct |
0 ms |
348 KB |
Output is correct |
115 |
Correct |
1 ms |
348 KB |
Output is correct |
116 |
Correct |
0 ms |
408 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 |
856 KB |
Output is correct |
120 |
Correct |
3 ms |
1116 KB |
Output is correct |
121 |
Correct |
500 ms |
54904 KB |
Output is correct |
122 |
Correct |
814 ms |
81072 KB |
Output is correct |
123 |
Correct |
815 ms |
79532 KB |
Output is correct |
124 |
Correct |
0 ms |
344 KB |
Output is correct |
125 |
Correct |
0 ms |
344 KB |
Output is correct |
126 |
Correct |
0 ms |
348 KB |
Output is correct |
127 |
Correct |
1081 ms |
118132 KB |
Output is correct |
128 |
Correct |
1033 ms |
118708 KB |
Output is correct |
129 |
Correct |
977 ms |
120340 KB |
Output is correct |
130 |
Correct |
5 ms |
1368 KB |
Output is correct |
131 |
Correct |
8 ms |
2096 KB |
Output is correct |
132 |
Correct |
496 ms |
50284 KB |
Output is correct |
133 |
Correct |
871 ms |
79348 KB |
Output is correct |
134 |
Correct |
1240 ms |
104364 KB |
Output is correct |
135 |
Correct |
1029 ms |
126996 KB |
Output is correct |
136 |
Correct |
1079 ms |
123936 KB |
Output is correct |
137 |
Correct |
1049 ms |
118832 KB |
Output is correct |
138 |
Correct |
1212 ms |
117940 KB |
Output is correct |
139 |
Correct |
1066 ms |
99996 KB |
Output is correct |
140 |
Correct |
1 ms |
348 KB |
Output is correct |
141 |
Correct |
140 ms |
15800 KB |
Output is correct |
142 |
Correct |
39 ms |
5356 KB |
Output is correct |
143 |
Correct |
93 ms |
14932 KB |
Output is correct |
144 |
Correct |
190 ms |
24196 KB |
Output is correct |
145 |
Correct |
629 ms |
56488 KB |
Output is correct |
146 |
Correct |
805 ms |
69568 KB |
Output is correct |
147 |
Correct |
936 ms |
84888 KB |
Output is correct |
148 |
Correct |
1120 ms |
98212 KB |
Output is correct |
149 |
Correct |
1490 ms |
112648 KB |
Output is correct |
150 |
Correct |
1162 ms |
121492 KB |
Output is correct |
151 |
Correct |
1052 ms |
126220 KB |
Output is correct |
152 |
Correct |
7 ms |
1628 KB |
Output is correct |
153 |
Correct |
10 ms |
2652 KB |
Output is correct |
154 |
Correct |
515 ms |
54484 KB |
Output is correct |
155 |
Correct |
897 ms |
84244 KB |
Output is correct |
156 |
Correct |
1225 ms |
110768 KB |
Output is correct |
157 |
Correct |
1 ms |
344 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 |
Incorrect |
930 ms |
136756 KB |
Solution announced impossible, but it is possible. |
162 |
Halted |
0 ms |
0 KB |
- |