#include <bits/stdc++.h>
#include "parks.h"
#define ar array
#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
using namespace std;
template<typename T> bool ckmin(T &a, const T &b) { return a > b ? a = b, 1 : 0; }
template<typename T> bool ckmax(T &a, const T &b) { return a < b ? a = b, 1 : 0; }
struct dsu {
vector<int> p, size;
dsu(int n) : p(n), size(n, 1) {
iota(all(p), 0);
}
int get(int v) {
return v == p[v] ? v : p[v] = get(p[v]);
}
bool merge(int a, int b) {
a = get(a), b = get(b);
if (a == b) return 0;
if (size[a] < size[b]) swap(a, b);
size[a] += size[b], p[b] = a;
return 1;
}
};
int construct_roads(std::vector<int> x, std::vector<int> y) {
int n = sz(x);
map<ar<int, 4>, int> mp;
map<ar<int, 2>, int> idx;
for (int i = 0; i < n; i++) idx[{x[i], y[i]}] = i;
vector<int> a(n-1), b(n-1), c(n-1), d(n-1);
dsu D(n);
int now = 0;
map<ar<int, 2>, int> adj;
for (int i = 0; i < n; i++) {
if (idx.count({x[i] + 2, y[i]})) {
mp[{x[i], y[i], x[i] + 2, y[i]}] += 2;
adj[{x[i] + 1, y[i] + 1}]++;
adj[{x[i] + 1, y[i] - 1}]++;
}
if (idx.count({x[i], y[i] + 2})) {
mp[{x[i], y[i], x[i], y[i] + 2}] += 2;
adj[{x[i] + 1, y[i] + 1}]++;
adj[{x[i] - 1, y[i] + 1}]++;
}
}
set<pair<int, ar<int, 2>>> q;
for (auto [x, y] : adj) q.insert({y, x});
set<ar<int, 2>> used;
while (q.size()) {
auto [val, p] = *q.begin();
q.erase(q.begin());
adj[p] = 0;
ar<int, 4> seg2{p[0] - 1, p[1] - 1, p[0] - 1, p[1] + 1};
ar<int, 4> seg3{p[0] + 1, p[1] - 1, p[0] + 1, p[1] + 1};
ar<int, 4> seg4{p[0] - 1, p[1] - 1, p[0] + 1, p[1] - 1};
ar<int, 4> seg5{p[0] - 1, p[1] + 1, p[0] + 1, p[1] + 1};
bool F = 0;
for (int tp = 0; tp <= 4; tp++) {
for (auto& seg : {seg2, seg3, seg4, seg5}) if (mp.count(seg) && mp[seg] == tp) {
int i1 = idx[{seg[0], seg[1]}], i2 = idx[{seg[2], seg[3]}];
if (D.get(i1) == D.get(i2)) continue;
ar<int, 2> pt, pt2;
if (seg[0] != seg[2]) {
pt = {seg[0] + 1, seg[1] - 1};
pt2 = {seg[0] + 1, seg[1] + 1};
}
else {
pt = {seg[0] - 1, seg[1] + 1};
pt2 = {seg[0] + 1, seg[1] + 1};
}
for (auto p : {pt, pt2}) {
if (q.count({adj[p], p})) q.erase({adj[p], p});
adj[p]--;
if (adj[p] > 0) q.insert({adj[p], p});
}
F = 1;
D.merge(i1, i2);
a[now] = i1, b[now] = i2;
c[now] = p[0], d[now] = p[1];
now++;
break;
}
if (F) break;
}
if (F) for (auto& seg : {seg2, seg3, seg4, seg5}) if (mp.count(seg)) mp[seg]--;
}
if (D.size[D.get(0)] != n) return 0;
build(a, b, c, d);
return 1;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
1 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 |
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 |
495 ms |
41812 KB |
Output is correct |
10 |
Correct |
32 ms |
4364 KB |
Output is correct |
11 |
Correct |
217 ms |
22608 KB |
Output is correct |
12 |
Correct |
72 ms |
6404 KB |
Output is correct |
13 |
Correct |
173 ms |
18776 KB |
Output is correct |
14 |
Correct |
3 ms |
604 KB |
Output is correct |
15 |
Correct |
5 ms |
1112 KB |
Output is correct |
16 |
Correct |
491 ms |
41912 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
1 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 |
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 |
495 ms |
41812 KB |
Output is correct |
10 |
Correct |
32 ms |
4364 KB |
Output is correct |
11 |
Correct |
217 ms |
22608 KB |
Output is correct |
12 |
Correct |
72 ms |
6404 KB |
Output is correct |
13 |
Correct |
173 ms |
18776 KB |
Output is correct |
14 |
Correct |
3 ms |
604 KB |
Output is correct |
15 |
Correct |
5 ms |
1112 KB |
Output is correct |
16 |
Correct |
491 ms |
41912 KB |
Output is correct |
17 |
Correct |
0 ms |
344 KB |
Output is correct |
18 |
Correct |
0 ms |
348 KB |
Output is correct |
19 |
Correct |
0 ms |
344 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 |
1761 ms |
77392 KB |
Output is correct |
24 |
Correct |
0 ms |
344 KB |
Output is correct |
25 |
Correct |
5 ms |
856 KB |
Output is correct |
26 |
Correct |
16 ms |
1576 KB |
Output is correct |
27 |
Correct |
17 ms |
1884 KB |
Output is correct |
28 |
Correct |
532 ms |
30928 KB |
Output is correct |
29 |
Correct |
865 ms |
46416 KB |
Output is correct |
30 |
Correct |
1340 ms |
61580 KB |
Output is correct |
31 |
Correct |
1790 ms |
77156 KB |
Output is correct |
32 |
Correct |
1 ms |
348 KB |
Output is correct |
33 |
Correct |
0 ms |
348 KB |
Output is correct |
34 |
Correct |
1 ms |
344 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 |
1 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 |
1 ms |
348 KB |
Output is correct |
42 |
Correct |
0 ms |
348 KB |
Output is correct |
43 |
Correct |
6 ms |
860 KB |
Output is correct |
44 |
Correct |
10 ms |
1436 KB |
Output is correct |
45 |
Correct |
501 ms |
33916 KB |
Output is correct |
46 |
Correct |
787 ms |
49324 KB |
Output is correct |
47 |
Correct |
821 ms |
49236 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
1 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 |
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 |
495 ms |
41812 KB |
Output is correct |
10 |
Correct |
32 ms |
4364 KB |
Output is correct |
11 |
Correct |
217 ms |
22608 KB |
Output is correct |
12 |
Correct |
72 ms |
6404 KB |
Output is correct |
13 |
Correct |
173 ms |
18776 KB |
Output is correct |
14 |
Correct |
3 ms |
604 KB |
Output is correct |
15 |
Correct |
5 ms |
1112 KB |
Output is correct |
16 |
Correct |
491 ms |
41912 KB |
Output is correct |
17 |
Correct |
0 ms |
344 KB |
Output is correct |
18 |
Correct |
0 ms |
348 KB |
Output is correct |
19 |
Correct |
0 ms |
344 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 |
1761 ms |
77392 KB |
Output is correct |
24 |
Correct |
0 ms |
344 KB |
Output is correct |
25 |
Correct |
5 ms |
856 KB |
Output is correct |
26 |
Correct |
16 ms |
1576 KB |
Output is correct |
27 |
Correct |
17 ms |
1884 KB |
Output is correct |
28 |
Correct |
532 ms |
30928 KB |
Output is correct |
29 |
Correct |
865 ms |
46416 KB |
Output is correct |
30 |
Correct |
1340 ms |
61580 KB |
Output is correct |
31 |
Correct |
1790 ms |
77156 KB |
Output is correct |
32 |
Correct |
1 ms |
348 KB |
Output is correct |
33 |
Correct |
0 ms |
348 KB |
Output is correct |
34 |
Correct |
1 ms |
344 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 |
1 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 |
1 ms |
348 KB |
Output is correct |
42 |
Correct |
0 ms |
348 KB |
Output is correct |
43 |
Correct |
6 ms |
860 KB |
Output is correct |
44 |
Correct |
10 ms |
1436 KB |
Output is correct |
45 |
Correct |
501 ms |
33916 KB |
Output is correct |
46 |
Correct |
787 ms |
49324 KB |
Output is correct |
47 |
Correct |
821 ms |
49236 KB |
Output is correct |
48 |
Correct |
1 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 |
344 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 |
1607 ms |
76628 KB |
Output is correct |
56 |
Correct |
1 ms |
348 KB |
Output is correct |
57 |
Correct |
9 ms |
1112 KB |
Output is correct |
58 |
Correct |
27 ms |
2652 KB |
Output is correct |
59 |
Correct |
49 ms |
4176 KB |
Output is correct |
60 |
Correct |
684 ms |
38480 KB |
Output is correct |
61 |
Correct |
972 ms |
51796 KB |
Output is correct |
62 |
Correct |
1286 ms |
63288 KB |
Output is correct |
63 |
Correct |
1612 ms |
76872 KB |
Output is correct |
64 |
Correct |
1 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 |
1132 ms |
84820 KB |
Output is correct |
68 |
Correct |
1090 ms |
84816 KB |
Output is correct |
69 |
Correct |
1126 ms |
84500 KB |
Output is correct |
70 |
Correct |
14 ms |
1624 KB |
Output is correct |
71 |
Correct |
27 ms |
3136 KB |
Output is correct |
72 |
Correct |
565 ms |
34132 KB |
Output is correct |
73 |
Correct |
989 ms |
51092 KB |
Output is correct |
74 |
Correct |
1361 ms |
68180 KB |
Output is correct |
75 |
Correct |
1550 ms |
77360 KB |
Output is correct |
76 |
Correct |
1192 ms |
84832 KB |
Output is correct |
77 |
Correct |
22 ms |
2140 KB |
Output is correct |
78 |
Correct |
36 ms |
3420 KB |
Output is correct |
79 |
Correct |
560 ms |
35892 KB |
Output is correct |
80 |
Correct |
1014 ms |
54100 KB |
Output is correct |
81 |
Correct |
1365 ms |
72016 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
1 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 |
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 |
495 ms |
41812 KB |
Output is correct |
10 |
Correct |
32 ms |
4364 KB |
Output is correct |
11 |
Correct |
217 ms |
22608 KB |
Output is correct |
12 |
Correct |
72 ms |
6404 KB |
Output is correct |
13 |
Correct |
173 ms |
18776 KB |
Output is correct |
14 |
Correct |
3 ms |
604 KB |
Output is correct |
15 |
Correct |
5 ms |
1112 KB |
Output is correct |
16 |
Correct |
491 ms |
41912 KB |
Output is correct |
17 |
Correct |
0 ms |
344 KB |
Output is correct |
18 |
Correct |
1 ms |
348 KB |
Output is correct |
19 |
Correct |
0 ms |
348 KB |
Output is correct |
20 |
Correct |
1032 ms |
58328 KB |
Output is correct |
21 |
Correct |
1117 ms |
58216 KB |
Output is correct |
22 |
Correct |
1012 ms |
58192 KB |
Output is correct |
23 |
Correct |
892 ms |
70988 KB |
Output is correct |
24 |
Correct |
184 ms |
20560 KB |
Output is correct |
25 |
Correct |
1128 ms |
83080 KB |
Output is correct |
26 |
Correct |
1058 ms |
83216 KB |
Output is correct |
27 |
Correct |
1064 ms |
83088 KB |
Output is correct |
28 |
Correct |
1104 ms |
83280 KB |
Output is correct |
29 |
Correct |
1151 ms |
83280 KB |
Output is correct |
30 |
Correct |
1209 ms |
83260 KB |
Output is correct |
31 |
Correct |
0 ms |
348 KB |
Output is correct |
32 |
Correct |
55 ms |
5276 KB |
Output is correct |
33 |
Correct |
75 ms |
11864 KB |
Output is correct |
34 |
Correct |
1027 ms |
60752 KB |
Output is correct |
35 |
Correct |
38 ms |
3840 KB |
Output is correct |
36 |
Correct |
218 ms |
16720 KB |
Output is correct |
37 |
Correct |
516 ms |
32896 KB |
Output is correct |
38 |
Correct |
390 ms |
26364 KB |
Output is correct |
39 |
Correct |
562 ms |
36096 KB |
Output is correct |
40 |
Correct |
755 ms |
45884 KB |
Output is correct |
41 |
Correct |
1044 ms |
55636 KB |
Output is correct |
42 |
Correct |
1229 ms |
65580 KB |
Output is correct |
43 |
Correct |
1 ms |
348 KB |
Output is correct |
44 |
Correct |
0 ms |
348 KB |
Output is correct |
45 |
Correct |
1 ms |
348 KB |
Output is correct |
46 |
Correct |
0 ms |
440 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 |
344 KB |
Output is correct |
51 |
Correct |
1 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 |
8 ms |
1120 KB |
Output is correct |
55 |
Correct |
9 ms |
1372 KB |
Output is correct |
56 |
Correct |
552 ms |
34772 KB |
Output is correct |
57 |
Correct |
790 ms |
50512 KB |
Output is correct |
58 |
Correct |
796 ms |
50532 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 |
344 KB |
Output is correct |
62 |
Correct |
1045 ms |
84916 KB |
Output is correct |
63 |
Correct |
1073 ms |
85060 KB |
Output is correct |
64 |
Correct |
1063 ms |
84564 KB |
Output is correct |
65 |
Correct |
13 ms |
1628 KB |
Output is correct |
66 |
Correct |
28 ms |
3056 KB |
Output is correct |
67 |
Correct |
539 ms |
34244 KB |
Output is correct |
68 |
Correct |
942 ms |
51336 KB |
Output is correct |
69 |
Correct |
1294 ms |
68180 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
1 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 |
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 |
495 ms |
41812 KB |
Output is correct |
10 |
Correct |
32 ms |
4364 KB |
Output is correct |
11 |
Correct |
217 ms |
22608 KB |
Output is correct |
12 |
Correct |
72 ms |
6404 KB |
Output is correct |
13 |
Correct |
173 ms |
18776 KB |
Output is correct |
14 |
Correct |
3 ms |
604 KB |
Output is correct |
15 |
Correct |
5 ms |
1112 KB |
Output is correct |
16 |
Correct |
491 ms |
41912 KB |
Output is correct |
17 |
Correct |
1108 ms |
83280 KB |
Output is correct |
18 |
Correct |
1158 ms |
83392 KB |
Output is correct |
19 |
Correct |
1037 ms |
58192 KB |
Output is correct |
20 |
Correct |
1442 ms |
71084 KB |
Output is correct |
21 |
Correct |
1068 ms |
70736 KB |
Output is correct |
22 |
Correct |
0 ms |
344 KB |
Output is correct |
23 |
Correct |
146 ms |
11984 KB |
Output is correct |
24 |
Correct |
94 ms |
7452 KB |
Output is correct |
25 |
Correct |
375 ms |
24908 KB |
Output is correct |
26 |
Correct |
705 ms |
42660 KB |
Output is correct |
27 |
Correct |
607 ms |
35680 KB |
Output is correct |
28 |
Correct |
836 ms |
44632 KB |
Output is correct |
29 |
Correct |
1087 ms |
53328 KB |
Output is correct |
30 |
Correct |
1307 ms |
62084 KB |
Output is correct |
31 |
Correct |
1547 ms |
70992 KB |
Output is correct |
32 |
Correct |
1452 ms |
77396 KB |
Output is correct |
33 |
Correct |
1082 ms |
84876 KB |
Output is correct |
34 |
Correct |
18 ms |
2140 KB |
Output is correct |
35 |
Correct |
35 ms |
3420 KB |
Output is correct |
36 |
Correct |
601 ms |
35924 KB |
Output is correct |
37 |
Correct |
1030 ms |
54100 KB |
Output is correct |
38 |
Correct |
1371 ms |
72120 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
1 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 |
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 |
495 ms |
41812 KB |
Output is correct |
10 |
Correct |
32 ms |
4364 KB |
Output is correct |
11 |
Correct |
217 ms |
22608 KB |
Output is correct |
12 |
Correct |
72 ms |
6404 KB |
Output is correct |
13 |
Correct |
173 ms |
18776 KB |
Output is correct |
14 |
Correct |
3 ms |
604 KB |
Output is correct |
15 |
Correct |
5 ms |
1112 KB |
Output is correct |
16 |
Correct |
491 ms |
41912 KB |
Output is correct |
17 |
Correct |
0 ms |
344 KB |
Output is correct |
18 |
Correct |
0 ms |
348 KB |
Output is correct |
19 |
Correct |
0 ms |
344 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 |
1761 ms |
77392 KB |
Output is correct |
24 |
Correct |
0 ms |
344 KB |
Output is correct |
25 |
Correct |
5 ms |
856 KB |
Output is correct |
26 |
Correct |
16 ms |
1576 KB |
Output is correct |
27 |
Correct |
17 ms |
1884 KB |
Output is correct |
28 |
Correct |
532 ms |
30928 KB |
Output is correct |
29 |
Correct |
865 ms |
46416 KB |
Output is correct |
30 |
Correct |
1340 ms |
61580 KB |
Output is correct |
31 |
Correct |
1790 ms |
77156 KB |
Output is correct |
32 |
Correct |
1 ms |
348 KB |
Output is correct |
33 |
Correct |
0 ms |
348 KB |
Output is correct |
34 |
Correct |
1 ms |
344 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 |
1 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 |
1 ms |
348 KB |
Output is correct |
42 |
Correct |
0 ms |
348 KB |
Output is correct |
43 |
Correct |
6 ms |
860 KB |
Output is correct |
44 |
Correct |
10 ms |
1436 KB |
Output is correct |
45 |
Correct |
501 ms |
33916 KB |
Output is correct |
46 |
Correct |
787 ms |
49324 KB |
Output is correct |
47 |
Correct |
821 ms |
49236 KB |
Output is correct |
48 |
Correct |
1 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 |
344 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 |
1607 ms |
76628 KB |
Output is correct |
56 |
Correct |
1 ms |
348 KB |
Output is correct |
57 |
Correct |
9 ms |
1112 KB |
Output is correct |
58 |
Correct |
27 ms |
2652 KB |
Output is correct |
59 |
Correct |
49 ms |
4176 KB |
Output is correct |
60 |
Correct |
684 ms |
38480 KB |
Output is correct |
61 |
Correct |
972 ms |
51796 KB |
Output is correct |
62 |
Correct |
1286 ms |
63288 KB |
Output is correct |
63 |
Correct |
1612 ms |
76872 KB |
Output is correct |
64 |
Correct |
1 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 |
1132 ms |
84820 KB |
Output is correct |
68 |
Correct |
1090 ms |
84816 KB |
Output is correct |
69 |
Correct |
1126 ms |
84500 KB |
Output is correct |
70 |
Correct |
14 ms |
1624 KB |
Output is correct |
71 |
Correct |
27 ms |
3136 KB |
Output is correct |
72 |
Correct |
565 ms |
34132 KB |
Output is correct |
73 |
Correct |
989 ms |
51092 KB |
Output is correct |
74 |
Correct |
1361 ms |
68180 KB |
Output is correct |
75 |
Correct |
1550 ms |
77360 KB |
Output is correct |
76 |
Correct |
1192 ms |
84832 KB |
Output is correct |
77 |
Correct |
22 ms |
2140 KB |
Output is correct |
78 |
Correct |
36 ms |
3420 KB |
Output is correct |
79 |
Correct |
560 ms |
35892 KB |
Output is correct |
80 |
Correct |
1014 ms |
54100 KB |
Output is correct |
81 |
Correct |
1365 ms |
72016 KB |
Output is correct |
82 |
Correct |
0 ms |
344 KB |
Output is correct |
83 |
Correct |
1 ms |
348 KB |
Output is correct |
84 |
Correct |
0 ms |
348 KB |
Output is correct |
85 |
Correct |
1032 ms |
58328 KB |
Output is correct |
86 |
Correct |
1117 ms |
58216 KB |
Output is correct |
87 |
Correct |
1012 ms |
58192 KB |
Output is correct |
88 |
Correct |
892 ms |
70988 KB |
Output is correct |
89 |
Correct |
184 ms |
20560 KB |
Output is correct |
90 |
Correct |
1128 ms |
83080 KB |
Output is correct |
91 |
Correct |
1058 ms |
83216 KB |
Output is correct |
92 |
Correct |
1064 ms |
83088 KB |
Output is correct |
93 |
Correct |
1104 ms |
83280 KB |
Output is correct |
94 |
Correct |
1151 ms |
83280 KB |
Output is correct |
95 |
Correct |
1209 ms |
83260 KB |
Output is correct |
96 |
Correct |
0 ms |
348 KB |
Output is correct |
97 |
Correct |
55 ms |
5276 KB |
Output is correct |
98 |
Correct |
75 ms |
11864 KB |
Output is correct |
99 |
Correct |
1027 ms |
60752 KB |
Output is correct |
100 |
Correct |
38 ms |
3840 KB |
Output is correct |
101 |
Correct |
218 ms |
16720 KB |
Output is correct |
102 |
Correct |
516 ms |
32896 KB |
Output is correct |
103 |
Correct |
390 ms |
26364 KB |
Output is correct |
104 |
Correct |
562 ms |
36096 KB |
Output is correct |
105 |
Correct |
755 ms |
45884 KB |
Output is correct |
106 |
Correct |
1044 ms |
55636 KB |
Output is correct |
107 |
Correct |
1229 ms |
65580 KB |
Output is correct |
108 |
Correct |
1 ms |
348 KB |
Output is correct |
109 |
Correct |
0 ms |
348 KB |
Output is correct |
110 |
Correct |
1 ms |
348 KB |
Output is correct |
111 |
Correct |
0 ms |
440 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 |
344 KB |
Output is correct |
116 |
Correct |
1 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 |
8 ms |
1120 KB |
Output is correct |
120 |
Correct |
9 ms |
1372 KB |
Output is correct |
121 |
Correct |
552 ms |
34772 KB |
Output is correct |
122 |
Correct |
790 ms |
50512 KB |
Output is correct |
123 |
Correct |
796 ms |
50532 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 |
344 KB |
Output is correct |
127 |
Correct |
1045 ms |
84916 KB |
Output is correct |
128 |
Correct |
1073 ms |
85060 KB |
Output is correct |
129 |
Correct |
1063 ms |
84564 KB |
Output is correct |
130 |
Correct |
13 ms |
1628 KB |
Output is correct |
131 |
Correct |
28 ms |
3056 KB |
Output is correct |
132 |
Correct |
539 ms |
34244 KB |
Output is correct |
133 |
Correct |
942 ms |
51336 KB |
Output is correct |
134 |
Correct |
1294 ms |
68180 KB |
Output is correct |
135 |
Correct |
1108 ms |
83280 KB |
Output is correct |
136 |
Correct |
1158 ms |
83392 KB |
Output is correct |
137 |
Correct |
1037 ms |
58192 KB |
Output is correct |
138 |
Correct |
1442 ms |
71084 KB |
Output is correct |
139 |
Correct |
1068 ms |
70736 KB |
Output is correct |
140 |
Correct |
0 ms |
344 KB |
Output is correct |
141 |
Correct |
146 ms |
11984 KB |
Output is correct |
142 |
Correct |
94 ms |
7452 KB |
Output is correct |
143 |
Correct |
375 ms |
24908 KB |
Output is correct |
144 |
Correct |
705 ms |
42660 KB |
Output is correct |
145 |
Correct |
607 ms |
35680 KB |
Output is correct |
146 |
Correct |
836 ms |
44632 KB |
Output is correct |
147 |
Correct |
1087 ms |
53328 KB |
Output is correct |
148 |
Correct |
1307 ms |
62084 KB |
Output is correct |
149 |
Correct |
1547 ms |
70992 KB |
Output is correct |
150 |
Correct |
1452 ms |
77396 KB |
Output is correct |
151 |
Correct |
1082 ms |
84876 KB |
Output is correct |
152 |
Correct |
18 ms |
2140 KB |
Output is correct |
153 |
Correct |
35 ms |
3420 KB |
Output is correct |
154 |
Correct |
601 ms |
35924 KB |
Output is correct |
155 |
Correct |
1030 ms |
54100 KB |
Output is correct |
156 |
Correct |
1371 ms |
72120 KB |
Output is correct |
157 |
Correct |
0 ms |
348 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 |
Correct |
1559 ms |
72768 KB |
Output is correct |
162 |
Correct |
1205 ms |
60640 KB |
Output is correct |
163 |
Correct |
1407 ms |
64840 KB |
Output is correct |
164 |
Correct |
1186 ms |
64956 KB |
Output is correct |
165 |
Correct |
1348 ms |
70224 KB |
Output is correct |
166 |
Correct |
1430 ms |
72132 KB |
Output is correct |
167 |
Correct |
257 ms |
17196 KB |
Output is correct |
168 |
Correct |
146 ms |
11268 KB |
Output is correct |
169 |
Correct |
443 ms |
29520 KB |
Output is correct |
170 |
Correct |
1010 ms |
54892 KB |
Output is correct |
171 |
Correct |
1457 ms |
72824 KB |
Output is correct |
172 |
Incorrect |
640 ms |
36748 KB |
Solution announced impossible, but it is possible. |
173 |
Halted |
0 ms |
0 KB |
- |