#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) {
if (z == 4) return 0;
}
visited.clear();
for (auto [y, z] : mp) {
auto [u, v] = y;
solve(u, v);
}
build(U, V, A, B);
return 1;
}
# |
결과 |
실행 시간 |
메모리 |
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 |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
344 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
448 ms |
61196 KB |
Output is correct |
10 |
Correct |
36 ms |
6484 KB |
Output is correct |
11 |
Correct |
249 ms |
33708 KB |
Output is correct |
12 |
Correct |
56 ms |
9556 KB |
Output is correct |
13 |
Correct |
66 ms |
15948 KB |
Output is correct |
14 |
Correct |
1 ms |
604 KB |
Output is correct |
15 |
Correct |
2 ms |
700 KB |
Output is correct |
16 |
Correct |
460 ms |
55560 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
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 |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
344 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
448 ms |
61196 KB |
Output is correct |
10 |
Correct |
36 ms |
6484 KB |
Output is correct |
11 |
Correct |
249 ms |
33708 KB |
Output is correct |
12 |
Correct |
56 ms |
9556 KB |
Output is correct |
13 |
Correct |
66 ms |
15948 KB |
Output is correct |
14 |
Correct |
1 ms |
604 KB |
Output is correct |
15 |
Correct |
2 ms |
700 KB |
Output is correct |
16 |
Correct |
460 ms |
55560 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 |
1398 ms |
131408 KB |
Output is correct |
24 |
Correct |
1 ms |
344 KB |
Output is correct |
25 |
Correct |
4 ms |
1116 KB |
Output is correct |
26 |
Correct |
3 ms |
1112 KB |
Output is correct |
27 |
Correct |
4 ms |
1088 KB |
Output is correct |
28 |
Correct |
416 ms |
54304 KB |
Output is correct |
29 |
Correct |
687 ms |
81616 KB |
Output is correct |
30 |
Correct |
976 ms |
111532 KB |
Output is correct |
31 |
Correct |
1314 ms |
128848 KB |
Output is correct |
32 |
Correct |
0 ms |
348 KB |
Output is correct |
33 |
Correct |
0 ms |
348 KB |
Output is correct |
34 |
Correct |
0 ms |
348 KB |
Output is correct |
35 |
Correct |
1 ms |
344 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 |
1 ms |
348 KB |
Output is correct |
43 |
Correct |
2 ms |
808 KB |
Output is correct |
44 |
Correct |
3 ms |
1116 KB |
Output is correct |
45 |
Correct |
477 ms |
54704 KB |
Output is correct |
46 |
Correct |
798 ms |
80952 KB |
Output is correct |
47 |
Correct |
774 ms |
79640 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
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 |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
344 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
448 ms |
61196 KB |
Output is correct |
10 |
Correct |
36 ms |
6484 KB |
Output is correct |
11 |
Correct |
249 ms |
33708 KB |
Output is correct |
12 |
Correct |
56 ms |
9556 KB |
Output is correct |
13 |
Correct |
66 ms |
15948 KB |
Output is correct |
14 |
Correct |
1 ms |
604 KB |
Output is correct |
15 |
Correct |
2 ms |
700 KB |
Output is correct |
16 |
Correct |
460 ms |
55560 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 |
1398 ms |
131408 KB |
Output is correct |
24 |
Correct |
1 ms |
344 KB |
Output is correct |
25 |
Correct |
4 ms |
1116 KB |
Output is correct |
26 |
Correct |
3 ms |
1112 KB |
Output is correct |
27 |
Correct |
4 ms |
1088 KB |
Output is correct |
28 |
Correct |
416 ms |
54304 KB |
Output is correct |
29 |
Correct |
687 ms |
81616 KB |
Output is correct |
30 |
Correct |
976 ms |
111532 KB |
Output is correct |
31 |
Correct |
1314 ms |
128848 KB |
Output is correct |
32 |
Correct |
0 ms |
348 KB |
Output is correct |
33 |
Correct |
0 ms |
348 KB |
Output is correct |
34 |
Correct |
0 ms |
348 KB |
Output is correct |
35 |
Correct |
1 ms |
344 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 |
1 ms |
348 KB |
Output is correct |
43 |
Correct |
2 ms |
808 KB |
Output is correct |
44 |
Correct |
3 ms |
1116 KB |
Output is correct |
45 |
Correct |
477 ms |
54704 KB |
Output is correct |
46 |
Correct |
798 ms |
80952 KB |
Output is correct |
47 |
Correct |
774 ms |
79640 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 |
1411 ms |
132652 KB |
Output is correct |
56 |
Correct |
1 ms |
348 KB |
Output is correct |
57 |
Correct |
6 ms |
1372 KB |
Output is correct |
58 |
Correct |
22 ms |
4400 KB |
Output is correct |
59 |
Correct |
12 ms |
2496 KB |
Output is correct |
60 |
Correct |
617 ms |
66856 KB |
Output is correct |
61 |
Correct |
856 ms |
91292 KB |
Output is correct |
62 |
Correct |
1064 ms |
109940 KB |
Output is correct |
63 |
Correct |
1345 ms |
131996 KB |
Output is correct |
64 |
Correct |
0 ms |
348 KB |
Output is correct |
65 |
Correct |
0 ms |
348 KB |
Output is correct |
66 |
Correct |
0 ms |
348 KB |
Output is correct |
67 |
Correct |
1061 ms |
118204 KB |
Output is correct |
68 |
Correct |
1016 ms |
118512 KB |
Output is correct |
69 |
Correct |
1016 ms |
120320 KB |
Output is correct |
70 |
Correct |
5 ms |
1372 KB |
Output is correct |
71 |
Correct |
8 ms |
2336 KB |
Output is correct |
72 |
Correct |
500 ms |
50200 KB |
Output is correct |
73 |
Correct |
841 ms |
79352 KB |
Output is correct |
74 |
Correct |
1216 ms |
104368 KB |
Output is correct |
75 |
Correct |
1181 ms |
121492 KB |
Output is correct |
76 |
Correct |
1059 ms |
126480 KB |
Output is correct |
77 |
Correct |
6 ms |
1880 KB |
Output is correct |
78 |
Correct |
10 ms |
2652 KB |
Output is correct |
79 |
Correct |
510 ms |
54568 KB |
Output is correct |
80 |
Correct |
848 ms |
84136 KB |
Output is correct |
81 |
Correct |
1188 ms |
110764 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
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 |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
344 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
448 ms |
61196 KB |
Output is correct |
10 |
Correct |
36 ms |
6484 KB |
Output is correct |
11 |
Correct |
249 ms |
33708 KB |
Output is correct |
12 |
Correct |
56 ms |
9556 KB |
Output is correct |
13 |
Correct |
66 ms |
15948 KB |
Output is correct |
14 |
Correct |
1 ms |
604 KB |
Output is correct |
15 |
Correct |
2 ms |
700 KB |
Output is correct |
16 |
Correct |
460 ms |
55560 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 |
999 ms |
120784 KB |
Output is correct |
21 |
Correct |
1016 ms |
115064 KB |
Output is correct |
22 |
Correct |
1054 ms |
111732 KB |
Output is correct |
23 |
Correct |
885 ms |
99352 KB |
Output is correct |
24 |
Correct |
396 ms |
67844 KB |
Output is correct |
25 |
Correct |
382 ms |
42788 KB |
Output is correct |
26 |
Correct |
332 ms |
42820 KB |
Output is correct |
27 |
Correct |
910 ms |
99244 KB |
Output is correct |
28 |
Correct |
887 ms |
99220 KB |
Output is correct |
29 |
Correct |
1157 ms |
98320 KB |
Output is correct |
30 |
Correct |
1194 ms |
98644 KB |
Output is correct |
31 |
Correct |
0 ms |
348 KB |
Output is correct |
32 |
Correct |
56 ms |
8000 KB |
Output is correct |
33 |
Correct |
143 ms |
28200 KB |
Output is correct |
34 |
Correct |
981 ms |
116364 KB |
Output is correct |
35 |
Correct |
14 ms |
2652 KB |
Output is correct |
36 |
Correct |
64 ms |
10732 KB |
Output is correct |
37 |
Correct |
147 ms |
20768 KB |
Output is correct |
38 |
Correct |
372 ms |
36312 KB |
Output is correct |
39 |
Correct |
584 ms |
49576 KB |
Output is correct |
40 |
Correct |
793 ms |
62272 KB |
Output is correct |
41 |
Correct |
1004 ms |
76800 KB |
Output is correct |
42 |
Correct |
1188 ms |
90788 KB |
Output is correct |
43 |
Correct |
1 ms |
344 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 |
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 |
2 ms |
860 KB |
Output is correct |
55 |
Correct |
3 ms |
1116 KB |
Output is correct |
56 |
Correct |
487 ms |
54856 KB |
Output is correct |
57 |
Correct |
756 ms |
81056 KB |
Output is correct |
58 |
Correct |
771 ms |
79528 KB |
Output is correct |
59 |
Correct |
1 ms |
344 KB |
Output is correct |
60 |
Correct |
0 ms |
348 KB |
Output is correct |
61 |
Correct |
0 ms |
348 KB |
Output is correct |
62 |
Correct |
1022 ms |
118100 KB |
Output is correct |
63 |
Correct |
1036 ms |
118540 KB |
Output is correct |
64 |
Correct |
1032 ms |
120344 KB |
Output is correct |
65 |
Correct |
5 ms |
1372 KB |
Output is correct |
66 |
Correct |
9 ms |
2100 KB |
Output is correct |
67 |
Correct |
479 ms |
50280 KB |
Output is correct |
68 |
Correct |
861 ms |
79360 KB |
Output is correct |
69 |
Correct |
1193 ms |
104360 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
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 |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
344 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
448 ms |
61196 KB |
Output is correct |
10 |
Correct |
36 ms |
6484 KB |
Output is correct |
11 |
Correct |
249 ms |
33708 KB |
Output is correct |
12 |
Correct |
56 ms |
9556 KB |
Output is correct |
13 |
Correct |
66 ms |
15948 KB |
Output is correct |
14 |
Correct |
1 ms |
604 KB |
Output is correct |
15 |
Correct |
2 ms |
700 KB |
Output is correct |
16 |
Correct |
460 ms |
55560 KB |
Output is correct |
17 |
Correct |
954 ms |
126988 KB |
Output is correct |
18 |
Correct |
1000 ms |
123932 KB |
Output is correct |
19 |
Correct |
1076 ms |
118832 KB |
Output is correct |
20 |
Correct |
1228 ms |
117636 KB |
Output is correct |
21 |
Correct |
1044 ms |
100036 KB |
Output is correct |
22 |
Correct |
0 ms |
348 KB |
Output is correct |
23 |
Correct |
139 ms |
15744 KB |
Output is correct |
24 |
Correct |
28 ms |
5556 KB |
Output is correct |
25 |
Correct |
92 ms |
14928 KB |
Output is correct |
26 |
Correct |
180 ms |
24144 KB |
Output is correct |
27 |
Correct |
601 ms |
56384 KB |
Output is correct |
28 |
Correct |
813 ms |
69716 KB |
Output is correct |
29 |
Correct |
992 ms |
85328 KB |
Output is correct |
30 |
Correct |
1136 ms |
98312 KB |
Output is correct |
31 |
Correct |
1397 ms |
112652 KB |
Output is correct |
32 |
Correct |
1166 ms |
121536 KB |
Output is correct |
33 |
Correct |
1064 ms |
126224 KB |
Output is correct |
34 |
Correct |
6 ms |
1628 KB |
Output is correct |
35 |
Correct |
11 ms |
2652 KB |
Output is correct |
36 |
Correct |
512 ms |
54516 KB |
Output is correct |
37 |
Correct |
817 ms |
84140 KB |
Output is correct |
38 |
Correct |
1245 ms |
110724 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
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 |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
344 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
448 ms |
61196 KB |
Output is correct |
10 |
Correct |
36 ms |
6484 KB |
Output is correct |
11 |
Correct |
249 ms |
33708 KB |
Output is correct |
12 |
Correct |
56 ms |
9556 KB |
Output is correct |
13 |
Correct |
66 ms |
15948 KB |
Output is correct |
14 |
Correct |
1 ms |
604 KB |
Output is correct |
15 |
Correct |
2 ms |
700 KB |
Output is correct |
16 |
Correct |
460 ms |
55560 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 |
1398 ms |
131408 KB |
Output is correct |
24 |
Correct |
1 ms |
344 KB |
Output is correct |
25 |
Correct |
4 ms |
1116 KB |
Output is correct |
26 |
Correct |
3 ms |
1112 KB |
Output is correct |
27 |
Correct |
4 ms |
1088 KB |
Output is correct |
28 |
Correct |
416 ms |
54304 KB |
Output is correct |
29 |
Correct |
687 ms |
81616 KB |
Output is correct |
30 |
Correct |
976 ms |
111532 KB |
Output is correct |
31 |
Correct |
1314 ms |
128848 KB |
Output is correct |
32 |
Correct |
0 ms |
348 KB |
Output is correct |
33 |
Correct |
0 ms |
348 KB |
Output is correct |
34 |
Correct |
0 ms |
348 KB |
Output is correct |
35 |
Correct |
1 ms |
344 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 |
1 ms |
348 KB |
Output is correct |
43 |
Correct |
2 ms |
808 KB |
Output is correct |
44 |
Correct |
3 ms |
1116 KB |
Output is correct |
45 |
Correct |
477 ms |
54704 KB |
Output is correct |
46 |
Correct |
798 ms |
80952 KB |
Output is correct |
47 |
Correct |
774 ms |
79640 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 |
1411 ms |
132652 KB |
Output is correct |
56 |
Correct |
1 ms |
348 KB |
Output is correct |
57 |
Correct |
6 ms |
1372 KB |
Output is correct |
58 |
Correct |
22 ms |
4400 KB |
Output is correct |
59 |
Correct |
12 ms |
2496 KB |
Output is correct |
60 |
Correct |
617 ms |
66856 KB |
Output is correct |
61 |
Correct |
856 ms |
91292 KB |
Output is correct |
62 |
Correct |
1064 ms |
109940 KB |
Output is correct |
63 |
Correct |
1345 ms |
131996 KB |
Output is correct |
64 |
Correct |
0 ms |
348 KB |
Output is correct |
65 |
Correct |
0 ms |
348 KB |
Output is correct |
66 |
Correct |
0 ms |
348 KB |
Output is correct |
67 |
Correct |
1061 ms |
118204 KB |
Output is correct |
68 |
Correct |
1016 ms |
118512 KB |
Output is correct |
69 |
Correct |
1016 ms |
120320 KB |
Output is correct |
70 |
Correct |
5 ms |
1372 KB |
Output is correct |
71 |
Correct |
8 ms |
2336 KB |
Output is correct |
72 |
Correct |
500 ms |
50200 KB |
Output is correct |
73 |
Correct |
841 ms |
79352 KB |
Output is correct |
74 |
Correct |
1216 ms |
104368 KB |
Output is correct |
75 |
Correct |
1181 ms |
121492 KB |
Output is correct |
76 |
Correct |
1059 ms |
126480 KB |
Output is correct |
77 |
Correct |
6 ms |
1880 KB |
Output is correct |
78 |
Correct |
10 ms |
2652 KB |
Output is correct |
79 |
Correct |
510 ms |
54568 KB |
Output is correct |
80 |
Correct |
848 ms |
84136 KB |
Output is correct |
81 |
Correct |
1188 ms |
110764 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 |
999 ms |
120784 KB |
Output is correct |
86 |
Correct |
1016 ms |
115064 KB |
Output is correct |
87 |
Correct |
1054 ms |
111732 KB |
Output is correct |
88 |
Correct |
885 ms |
99352 KB |
Output is correct |
89 |
Correct |
396 ms |
67844 KB |
Output is correct |
90 |
Correct |
382 ms |
42788 KB |
Output is correct |
91 |
Correct |
332 ms |
42820 KB |
Output is correct |
92 |
Correct |
910 ms |
99244 KB |
Output is correct |
93 |
Correct |
887 ms |
99220 KB |
Output is correct |
94 |
Correct |
1157 ms |
98320 KB |
Output is correct |
95 |
Correct |
1194 ms |
98644 KB |
Output is correct |
96 |
Correct |
0 ms |
348 KB |
Output is correct |
97 |
Correct |
56 ms |
8000 KB |
Output is correct |
98 |
Correct |
143 ms |
28200 KB |
Output is correct |
99 |
Correct |
981 ms |
116364 KB |
Output is correct |
100 |
Correct |
14 ms |
2652 KB |
Output is correct |
101 |
Correct |
64 ms |
10732 KB |
Output is correct |
102 |
Correct |
147 ms |
20768 KB |
Output is correct |
103 |
Correct |
372 ms |
36312 KB |
Output is correct |
104 |
Correct |
584 ms |
49576 KB |
Output is correct |
105 |
Correct |
793 ms |
62272 KB |
Output is correct |
106 |
Correct |
1004 ms |
76800 KB |
Output is correct |
107 |
Correct |
1188 ms |
90788 KB |
Output is correct |
108 |
Correct |
1 ms |
344 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 |
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 |
2 ms |
860 KB |
Output is correct |
120 |
Correct |
3 ms |
1116 KB |
Output is correct |
121 |
Correct |
487 ms |
54856 KB |
Output is correct |
122 |
Correct |
756 ms |
81056 KB |
Output is correct |
123 |
Correct |
771 ms |
79528 KB |
Output is correct |
124 |
Correct |
1 ms |
344 KB |
Output is correct |
125 |
Correct |
0 ms |
348 KB |
Output is correct |
126 |
Correct |
0 ms |
348 KB |
Output is correct |
127 |
Correct |
1022 ms |
118100 KB |
Output is correct |
128 |
Correct |
1036 ms |
118540 KB |
Output is correct |
129 |
Correct |
1032 ms |
120344 KB |
Output is correct |
130 |
Correct |
5 ms |
1372 KB |
Output is correct |
131 |
Correct |
9 ms |
2100 KB |
Output is correct |
132 |
Correct |
479 ms |
50280 KB |
Output is correct |
133 |
Correct |
861 ms |
79360 KB |
Output is correct |
134 |
Correct |
1193 ms |
104360 KB |
Output is correct |
135 |
Correct |
954 ms |
126988 KB |
Output is correct |
136 |
Correct |
1000 ms |
123932 KB |
Output is correct |
137 |
Correct |
1076 ms |
118832 KB |
Output is correct |
138 |
Correct |
1228 ms |
117636 KB |
Output is correct |
139 |
Correct |
1044 ms |
100036 KB |
Output is correct |
140 |
Correct |
0 ms |
348 KB |
Output is correct |
141 |
Correct |
139 ms |
15744 KB |
Output is correct |
142 |
Correct |
28 ms |
5556 KB |
Output is correct |
143 |
Correct |
92 ms |
14928 KB |
Output is correct |
144 |
Correct |
180 ms |
24144 KB |
Output is correct |
145 |
Correct |
601 ms |
56384 KB |
Output is correct |
146 |
Correct |
813 ms |
69716 KB |
Output is correct |
147 |
Correct |
992 ms |
85328 KB |
Output is correct |
148 |
Correct |
1136 ms |
98312 KB |
Output is correct |
149 |
Correct |
1397 ms |
112652 KB |
Output is correct |
150 |
Correct |
1166 ms |
121536 KB |
Output is correct |
151 |
Correct |
1064 ms |
126224 KB |
Output is correct |
152 |
Correct |
6 ms |
1628 KB |
Output is correct |
153 |
Correct |
11 ms |
2652 KB |
Output is correct |
154 |
Correct |
512 ms |
54516 KB |
Output is correct |
155 |
Correct |
817 ms |
84140 KB |
Output is correct |
156 |
Correct |
1245 ms |
110724 KB |
Output is correct |
157 |
Correct |
1 ms |
344 KB |
Output is correct |
158 |
Correct |
0 ms |
344 KB |
Output is correct |
159 |
Correct |
0 ms |
348 KB |
Output is correct |
160 |
Correct |
0 ms |
348 KB |
Output is correct |
161 |
Incorrect |
906 ms |
133724 KB |
Solution announced impossible, but it is possible. |
162 |
Halted |
0 ms |
0 KB |
- |