#pragma GCC optimize("Ofast,unroll-loops")
#include "parks.h"
#include <bits/stdc++.h>
#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
#define F first
#define S second
using namespace std;
map<pii, int> id;
int n, m, deg[200000], dsu[200000], vis[400001], use[400001], hmm;
pii pos[400001];
vector<pair<pii, pii>> edge;
vector<pii> E[400001];
vector<int> ru, rv, bx, by;
int find(int k)
{
return dsu[k] == k ? k : dsu[k] = find(dsu[k]);
}
void merge(int x, int y)
{
x = find(x), y = find(y);
dsu[x] = y;
}
int node(int x, int y)
{
if (!id[pii(x, y)])
{
id[pii(x, y)] = ++m;
pos[m] = pii(x, y);
}
return id[pii(x, y)];
}
void dfs(int u, int p)
{
vis[u] = 1;
int flag = 1;
for (auto [v, i] : E[u])
if (!vis[v])
dfs(v, u);
hmm += E[u].size();
hmm -= 2;
for (auto [v, i] : E[u])
if (v != p && !use[i] && flag)
{
flag--;
use[i] = 1;
tie(bx[i], by[i]) = pos[u];
}
for (auto [v, i] : E[u])
if (!use[i] && flag)
{
flag--;
use[i] = 1;
tie(bx[i], by[i]) = pos[u];
}
}
int construct_roads(vector<int> x, vector<int> y)
{
n = x.size();
for (int i = 0; i < n; i++)
dsu[i] = i;
for (int i = 0; i < n; i++)
id[pii(x[i], y[i])] = i + 1;
bx.resize(n - 1), by.resize(n - 1);
for (int i = 0; i < n; i++)
{
if (id.find(pii(x[i], y[i] - 2)) != id.end())
{
int j = id[pii(x[i], y[i] - 2)] - 1;
merge(i, j);
ru.emplace_back(i);
rv.emplace_back(j);
}
if (id.find(pii(x[i] - 2, y[i])) != id.end())
{
int j = id[pii(x[i] - 2, y[i])] - 1;
edge.emplace_back(make_pair(pii(x[i] - 1, y[i]), pii(i, j)));
}
}
sort(edge.begin(), edge.end(), [&](pair<pii, pii> f, pair<pii, pii> s)
{
pii p = f.F, q = s.F;
if(p.F != q.F)
return p.F < q.F;
if(p.F % 4 == 1)
return p.S < q.S;
return p.S > q.S; });
mt19937 rd(chrono::steady_clock::now().time_since_epoch().count());
shuffle(edge.begin(), edge.end(), rd);
for (auto [_, p] : edge)
{
auto [u, v] = p;
if (find(u) != find(v))
{
ru.emplace_back(u);
rv.emplace_back(v);
merge(u, v);
}
}
if (ru.size() < n - 1)
return 0;
id.clear();
for (int i = 0; i < n - 1; i++)
{
int u = ru[i], v = rv[i];
if (x[u] == x[v])
{
int a = node(x[u] - 1, (y[u] + y[v]) / 2),
b = node(x[u] + 1, (y[u] + y[v]) / 2);
E[a].emplace_back(pii(b, i));
E[b].emplace_back(pii(a, i));
}
else
{
int a = node((x[u] + x[v]) / 2, y[u] + 1),
b = node((x[u] + x[v]) / 2, y[u] - 1);
E[a].emplace_back(pii(b, i));
E[b].emplace_back(pii(a, i));
}
}
for (int i = 1; i <= m; i++)
if (!vis[i])
{
hmm = 0;
dfs(i, i);
if(hmm > 0)
return 0;
}
build(ru, rv, bx, by);
return 1;
}
Compilation message
parks.cpp: In function 'int construct_roads(std::vector<int>, std::vector<int>)':
parks.cpp:108:19: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
108 | if (ru.size() < n - 1)
| ~~~~~~~~~~^~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
9684 KB |
Output is correct |
2 |
Correct |
5 ms |
9684 KB |
Output is correct |
3 |
Correct |
5 ms |
9684 KB |
Output is correct |
4 |
Correct |
5 ms |
9684 KB |
Output is correct |
5 |
Correct |
5 ms |
9600 KB |
Output is correct |
6 |
Correct |
5 ms |
9684 KB |
Output is correct |
7 |
Correct |
5 ms |
9684 KB |
Output is correct |
8 |
Correct |
5 ms |
9684 KB |
Output is correct |
9 |
Correct |
278 ms |
37804 KB |
Output is correct |
10 |
Correct |
19 ms |
12628 KB |
Output is correct |
11 |
Correct |
90 ms |
24832 KB |
Output is correct |
12 |
Correct |
25 ms |
14136 KB |
Output is correct |
13 |
Correct |
29 ms |
14224 KB |
Output is correct |
14 |
Correct |
6 ms |
9768 KB |
Output is correct |
15 |
Correct |
6 ms |
9812 KB |
Output is correct |
16 |
Correct |
298 ms |
37840 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
9684 KB |
Output is correct |
2 |
Correct |
5 ms |
9684 KB |
Output is correct |
3 |
Correct |
5 ms |
9684 KB |
Output is correct |
4 |
Correct |
5 ms |
9684 KB |
Output is correct |
5 |
Correct |
5 ms |
9600 KB |
Output is correct |
6 |
Correct |
5 ms |
9684 KB |
Output is correct |
7 |
Correct |
5 ms |
9684 KB |
Output is correct |
8 |
Correct |
5 ms |
9684 KB |
Output is correct |
9 |
Correct |
278 ms |
37804 KB |
Output is correct |
10 |
Correct |
19 ms |
12628 KB |
Output is correct |
11 |
Correct |
90 ms |
24832 KB |
Output is correct |
12 |
Correct |
25 ms |
14136 KB |
Output is correct |
13 |
Correct |
29 ms |
14224 KB |
Output is correct |
14 |
Correct |
6 ms |
9768 KB |
Output is correct |
15 |
Correct |
6 ms |
9812 KB |
Output is correct |
16 |
Correct |
298 ms |
37840 KB |
Output is correct |
17 |
Correct |
5 ms |
9684 KB |
Output is correct |
18 |
Correct |
6 ms |
9684 KB |
Output is correct |
19 |
Correct |
5 ms |
9684 KB |
Output is correct |
20 |
Correct |
6 ms |
9684 KB |
Output is correct |
21 |
Correct |
5 ms |
9596 KB |
Output is correct |
22 |
Correct |
5 ms |
9628 KB |
Output is correct |
23 |
Correct |
846 ms |
59768 KB |
Output is correct |
24 |
Correct |
5 ms |
9684 KB |
Output is correct |
25 |
Correct |
7 ms |
9924 KB |
Output is correct |
26 |
Correct |
7 ms |
10068 KB |
Output is correct |
27 |
Correct |
7 ms |
10068 KB |
Output is correct |
28 |
Correct |
219 ms |
29592 KB |
Output is correct |
29 |
Correct |
347 ms |
39696 KB |
Output is correct |
30 |
Correct |
561 ms |
49680 KB |
Output is correct |
31 |
Correct |
736 ms |
59940 KB |
Output is correct |
32 |
Correct |
5 ms |
9684 KB |
Output is correct |
33 |
Correct |
5 ms |
9684 KB |
Output is correct |
34 |
Correct |
5 ms |
9684 KB |
Output is correct |
35 |
Correct |
5 ms |
9684 KB |
Output is correct |
36 |
Correct |
5 ms |
9684 KB |
Output is correct |
37 |
Correct |
5 ms |
9684 KB |
Output is correct |
38 |
Correct |
5 ms |
9684 KB |
Output is correct |
39 |
Correct |
5 ms |
9684 KB |
Output is correct |
40 |
Correct |
5 ms |
9684 KB |
Output is correct |
41 |
Correct |
10 ms |
9656 KB |
Output is correct |
42 |
Correct |
5 ms |
9684 KB |
Output is correct |
43 |
Correct |
6 ms |
9812 KB |
Output is correct |
44 |
Correct |
7 ms |
10012 KB |
Output is correct |
45 |
Correct |
247 ms |
31716 KB |
Output is correct |
46 |
Correct |
409 ms |
41732 KB |
Output is correct |
47 |
Correct |
400 ms |
41680 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
9684 KB |
Output is correct |
2 |
Correct |
5 ms |
9684 KB |
Output is correct |
3 |
Correct |
5 ms |
9684 KB |
Output is correct |
4 |
Correct |
5 ms |
9684 KB |
Output is correct |
5 |
Correct |
5 ms |
9600 KB |
Output is correct |
6 |
Correct |
5 ms |
9684 KB |
Output is correct |
7 |
Correct |
5 ms |
9684 KB |
Output is correct |
8 |
Correct |
5 ms |
9684 KB |
Output is correct |
9 |
Correct |
278 ms |
37804 KB |
Output is correct |
10 |
Correct |
19 ms |
12628 KB |
Output is correct |
11 |
Correct |
90 ms |
24832 KB |
Output is correct |
12 |
Correct |
25 ms |
14136 KB |
Output is correct |
13 |
Correct |
29 ms |
14224 KB |
Output is correct |
14 |
Correct |
6 ms |
9768 KB |
Output is correct |
15 |
Correct |
6 ms |
9812 KB |
Output is correct |
16 |
Correct |
298 ms |
37840 KB |
Output is correct |
17 |
Correct |
5 ms |
9684 KB |
Output is correct |
18 |
Correct |
6 ms |
9684 KB |
Output is correct |
19 |
Correct |
5 ms |
9684 KB |
Output is correct |
20 |
Correct |
6 ms |
9684 KB |
Output is correct |
21 |
Correct |
5 ms |
9596 KB |
Output is correct |
22 |
Correct |
5 ms |
9628 KB |
Output is correct |
23 |
Correct |
846 ms |
59768 KB |
Output is correct |
24 |
Correct |
5 ms |
9684 KB |
Output is correct |
25 |
Correct |
7 ms |
9924 KB |
Output is correct |
26 |
Correct |
7 ms |
10068 KB |
Output is correct |
27 |
Correct |
7 ms |
10068 KB |
Output is correct |
28 |
Correct |
219 ms |
29592 KB |
Output is correct |
29 |
Correct |
347 ms |
39696 KB |
Output is correct |
30 |
Correct |
561 ms |
49680 KB |
Output is correct |
31 |
Correct |
736 ms |
59940 KB |
Output is correct |
32 |
Correct |
5 ms |
9684 KB |
Output is correct |
33 |
Correct |
5 ms |
9684 KB |
Output is correct |
34 |
Correct |
5 ms |
9684 KB |
Output is correct |
35 |
Correct |
5 ms |
9684 KB |
Output is correct |
36 |
Correct |
5 ms |
9684 KB |
Output is correct |
37 |
Correct |
5 ms |
9684 KB |
Output is correct |
38 |
Correct |
5 ms |
9684 KB |
Output is correct |
39 |
Correct |
5 ms |
9684 KB |
Output is correct |
40 |
Correct |
5 ms |
9684 KB |
Output is correct |
41 |
Correct |
10 ms |
9656 KB |
Output is correct |
42 |
Correct |
5 ms |
9684 KB |
Output is correct |
43 |
Correct |
6 ms |
9812 KB |
Output is correct |
44 |
Correct |
7 ms |
10012 KB |
Output is correct |
45 |
Correct |
247 ms |
31716 KB |
Output is correct |
46 |
Correct |
409 ms |
41732 KB |
Output is correct |
47 |
Correct |
400 ms |
41680 KB |
Output is correct |
48 |
Correct |
6 ms |
9684 KB |
Output is correct |
49 |
Correct |
5 ms |
9660 KB |
Output is correct |
50 |
Correct |
5 ms |
9684 KB |
Output is correct |
51 |
Correct |
5 ms |
9684 KB |
Output is correct |
52 |
Correct |
6 ms |
9644 KB |
Output is correct |
53 |
Correct |
5 ms |
9684 KB |
Output is correct |
54 |
Correct |
6 ms |
9616 KB |
Output is correct |
55 |
Correct |
709 ms |
56788 KB |
Output is correct |
56 |
Correct |
5 ms |
9684 KB |
Output is correct |
57 |
Correct |
8 ms |
10068 KB |
Output is correct |
58 |
Correct |
15 ms |
11096 KB |
Output is correct |
59 |
Correct |
13 ms |
10904 KB |
Output is correct |
60 |
Correct |
297 ms |
33176 KB |
Output is correct |
61 |
Correct |
413 ms |
41228 KB |
Output is correct |
62 |
Correct |
564 ms |
48952 KB |
Output is correct |
63 |
Correct |
684 ms |
56724 KB |
Output is correct |
64 |
Correct |
5 ms |
9684 KB |
Output is correct |
65 |
Correct |
6 ms |
9684 KB |
Output is correct |
66 |
Correct |
5 ms |
9684 KB |
Output is correct |
67 |
Correct |
562 ms |
66072 KB |
Output is correct |
68 |
Correct |
637 ms |
66036 KB |
Output is correct |
69 |
Correct |
563 ms |
65768 KB |
Output is correct |
70 |
Correct |
7 ms |
10064 KB |
Output is correct |
71 |
Correct |
10 ms |
10528 KB |
Output is correct |
72 |
Correct |
255 ms |
32652 KB |
Output is correct |
73 |
Correct |
414 ms |
42084 KB |
Output is correct |
74 |
Correct |
608 ms |
55696 KB |
Output is correct |
75 |
Correct |
637 ms |
61624 KB |
Output is correct |
76 |
Correct |
589 ms |
66020 KB |
Output is correct |
77 |
Correct |
8 ms |
10196 KB |
Output is correct |
78 |
Correct |
11 ms |
10732 KB |
Output is correct |
79 |
Correct |
269 ms |
33712 KB |
Output is correct |
80 |
Correct |
416 ms |
43788 KB |
Output is correct |
81 |
Correct |
679 ms |
58236 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
9684 KB |
Output is correct |
2 |
Correct |
5 ms |
9684 KB |
Output is correct |
3 |
Correct |
5 ms |
9684 KB |
Output is correct |
4 |
Correct |
5 ms |
9684 KB |
Output is correct |
5 |
Correct |
5 ms |
9600 KB |
Output is correct |
6 |
Correct |
5 ms |
9684 KB |
Output is correct |
7 |
Correct |
5 ms |
9684 KB |
Output is correct |
8 |
Correct |
5 ms |
9684 KB |
Output is correct |
9 |
Correct |
278 ms |
37804 KB |
Output is correct |
10 |
Correct |
19 ms |
12628 KB |
Output is correct |
11 |
Correct |
90 ms |
24832 KB |
Output is correct |
12 |
Correct |
25 ms |
14136 KB |
Output is correct |
13 |
Correct |
29 ms |
14224 KB |
Output is correct |
14 |
Correct |
6 ms |
9768 KB |
Output is correct |
15 |
Correct |
6 ms |
9812 KB |
Output is correct |
16 |
Correct |
298 ms |
37840 KB |
Output is correct |
17 |
Correct |
5 ms |
9684 KB |
Output is correct |
18 |
Correct |
5 ms |
9712 KB |
Output is correct |
19 |
Correct |
6 ms |
9648 KB |
Output is correct |
20 |
Correct |
614 ms |
65416 KB |
Output is correct |
21 |
Correct |
637 ms |
56600 KB |
Output is correct |
22 |
Correct |
618 ms |
55576 KB |
Output is correct |
23 |
Correct |
459 ms |
62356 KB |
Output is correct |
24 |
Correct |
197 ms |
27704 KB |
Output is correct |
25 |
Correct |
294 ms |
33708 KB |
Output is correct |
26 |
Correct |
255 ms |
29420 KB |
Output is correct |
27 |
Correct |
627 ms |
66004 KB |
Output is correct |
28 |
Correct |
651 ms |
65952 KB |
Output is correct |
29 |
Correct |
661 ms |
71720 KB |
Output is correct |
30 |
Correct |
667 ms |
71940 KB |
Output is correct |
31 |
Correct |
5 ms |
9684 KB |
Output is correct |
32 |
Correct |
32 ms |
12972 KB |
Output is correct |
33 |
Correct |
73 ms |
18644 KB |
Output is correct |
34 |
Correct |
804 ms |
62852 KB |
Output is correct |
35 |
Correct |
13 ms |
10836 KB |
Output is correct |
36 |
Correct |
50 ms |
15132 KB |
Output is correct |
37 |
Correct |
109 ms |
20564 KB |
Output is correct |
38 |
Correct |
228 ms |
27492 KB |
Output is correct |
39 |
Correct |
302 ms |
34096 KB |
Output is correct |
40 |
Correct |
496 ms |
41148 KB |
Output is correct |
41 |
Correct |
718 ms |
47464 KB |
Output is correct |
42 |
Correct |
736 ms |
54296 KB |
Output is correct |
43 |
Correct |
5 ms |
9684 KB |
Output is correct |
44 |
Correct |
5 ms |
9684 KB |
Output is correct |
45 |
Correct |
6 ms |
9684 KB |
Output is correct |
46 |
Correct |
5 ms |
9684 KB |
Output is correct |
47 |
Correct |
6 ms |
9684 KB |
Output is correct |
48 |
Correct |
5 ms |
9616 KB |
Output is correct |
49 |
Correct |
5 ms |
9684 KB |
Output is correct |
50 |
Correct |
7 ms |
9684 KB |
Output is correct |
51 |
Correct |
5 ms |
9684 KB |
Output is correct |
52 |
Correct |
5 ms |
9684 KB |
Output is correct |
53 |
Correct |
5 ms |
9684 KB |
Output is correct |
54 |
Correct |
6 ms |
9812 KB |
Output is correct |
55 |
Correct |
6 ms |
9976 KB |
Output is correct |
56 |
Correct |
265 ms |
31828 KB |
Output is correct |
57 |
Correct |
442 ms |
41780 KB |
Output is correct |
58 |
Correct |
421 ms |
41728 KB |
Output is correct |
59 |
Correct |
6 ms |
9684 KB |
Output is correct |
60 |
Correct |
6 ms |
9724 KB |
Output is correct |
61 |
Correct |
5 ms |
9684 KB |
Output is correct |
62 |
Correct |
617 ms |
66016 KB |
Output is correct |
63 |
Correct |
583 ms |
66128 KB |
Output is correct |
64 |
Correct |
600 ms |
65748 KB |
Output is correct |
65 |
Correct |
8 ms |
10108 KB |
Output is correct |
66 |
Correct |
10 ms |
10580 KB |
Output is correct |
67 |
Correct |
237 ms |
32696 KB |
Output is correct |
68 |
Correct |
455 ms |
42236 KB |
Output is correct |
69 |
Correct |
616 ms |
55756 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
9684 KB |
Output is correct |
2 |
Correct |
5 ms |
9684 KB |
Output is correct |
3 |
Correct |
5 ms |
9684 KB |
Output is correct |
4 |
Correct |
5 ms |
9684 KB |
Output is correct |
5 |
Correct |
5 ms |
9600 KB |
Output is correct |
6 |
Correct |
5 ms |
9684 KB |
Output is correct |
7 |
Correct |
5 ms |
9684 KB |
Output is correct |
8 |
Correct |
5 ms |
9684 KB |
Output is correct |
9 |
Correct |
278 ms |
37804 KB |
Output is correct |
10 |
Correct |
19 ms |
12628 KB |
Output is correct |
11 |
Correct |
90 ms |
24832 KB |
Output is correct |
12 |
Correct |
25 ms |
14136 KB |
Output is correct |
13 |
Correct |
29 ms |
14224 KB |
Output is correct |
14 |
Correct |
6 ms |
9768 KB |
Output is correct |
15 |
Correct |
6 ms |
9812 KB |
Output is correct |
16 |
Correct |
298 ms |
37840 KB |
Output is correct |
17 |
Correct |
598 ms |
70988 KB |
Output is correct |
18 |
Correct |
562 ms |
71176 KB |
Output is correct |
19 |
Correct |
643 ms |
63684 KB |
Output is correct |
20 |
Correct |
707 ms |
55740 KB |
Output is correct |
21 |
Correct |
551 ms |
56668 KB |
Output is correct |
22 |
Correct |
5 ms |
9684 KB |
Output is correct |
23 |
Correct |
78 ms |
17068 KB |
Output is correct |
24 |
Correct |
29 ms |
11984 KB |
Output is correct |
25 |
Correct |
77 ms |
17788 KB |
Output is correct |
26 |
Correct |
139 ms |
23616 KB |
Output is correct |
27 |
Correct |
322 ms |
32928 KB |
Output is correct |
28 |
Correct |
354 ms |
38828 KB |
Output is correct |
29 |
Correct |
500 ms |
44684 KB |
Output is correct |
30 |
Correct |
620 ms |
50664 KB |
Output is correct |
31 |
Correct |
783 ms |
56272 KB |
Output is correct |
32 |
Correct |
635 ms |
61560 KB |
Output is correct |
33 |
Correct |
728 ms |
66012 KB |
Output is correct |
34 |
Correct |
8 ms |
10196 KB |
Output is correct |
35 |
Correct |
11 ms |
10680 KB |
Output is correct |
36 |
Correct |
290 ms |
33636 KB |
Output is correct |
37 |
Correct |
478 ms |
43884 KB |
Output is correct |
38 |
Correct |
797 ms |
58180 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
9684 KB |
Output is correct |
2 |
Correct |
5 ms |
9684 KB |
Output is correct |
3 |
Correct |
5 ms |
9684 KB |
Output is correct |
4 |
Correct |
5 ms |
9684 KB |
Output is correct |
5 |
Correct |
5 ms |
9600 KB |
Output is correct |
6 |
Correct |
5 ms |
9684 KB |
Output is correct |
7 |
Correct |
5 ms |
9684 KB |
Output is correct |
8 |
Correct |
5 ms |
9684 KB |
Output is correct |
9 |
Correct |
278 ms |
37804 KB |
Output is correct |
10 |
Correct |
19 ms |
12628 KB |
Output is correct |
11 |
Correct |
90 ms |
24832 KB |
Output is correct |
12 |
Correct |
25 ms |
14136 KB |
Output is correct |
13 |
Correct |
29 ms |
14224 KB |
Output is correct |
14 |
Correct |
6 ms |
9768 KB |
Output is correct |
15 |
Correct |
6 ms |
9812 KB |
Output is correct |
16 |
Correct |
298 ms |
37840 KB |
Output is correct |
17 |
Correct |
5 ms |
9684 KB |
Output is correct |
18 |
Correct |
6 ms |
9684 KB |
Output is correct |
19 |
Correct |
5 ms |
9684 KB |
Output is correct |
20 |
Correct |
6 ms |
9684 KB |
Output is correct |
21 |
Correct |
5 ms |
9596 KB |
Output is correct |
22 |
Correct |
5 ms |
9628 KB |
Output is correct |
23 |
Correct |
846 ms |
59768 KB |
Output is correct |
24 |
Correct |
5 ms |
9684 KB |
Output is correct |
25 |
Correct |
7 ms |
9924 KB |
Output is correct |
26 |
Correct |
7 ms |
10068 KB |
Output is correct |
27 |
Correct |
7 ms |
10068 KB |
Output is correct |
28 |
Correct |
219 ms |
29592 KB |
Output is correct |
29 |
Correct |
347 ms |
39696 KB |
Output is correct |
30 |
Correct |
561 ms |
49680 KB |
Output is correct |
31 |
Correct |
736 ms |
59940 KB |
Output is correct |
32 |
Correct |
5 ms |
9684 KB |
Output is correct |
33 |
Correct |
5 ms |
9684 KB |
Output is correct |
34 |
Correct |
5 ms |
9684 KB |
Output is correct |
35 |
Correct |
5 ms |
9684 KB |
Output is correct |
36 |
Correct |
5 ms |
9684 KB |
Output is correct |
37 |
Correct |
5 ms |
9684 KB |
Output is correct |
38 |
Correct |
5 ms |
9684 KB |
Output is correct |
39 |
Correct |
5 ms |
9684 KB |
Output is correct |
40 |
Correct |
5 ms |
9684 KB |
Output is correct |
41 |
Correct |
10 ms |
9656 KB |
Output is correct |
42 |
Correct |
5 ms |
9684 KB |
Output is correct |
43 |
Correct |
6 ms |
9812 KB |
Output is correct |
44 |
Correct |
7 ms |
10012 KB |
Output is correct |
45 |
Correct |
247 ms |
31716 KB |
Output is correct |
46 |
Correct |
409 ms |
41732 KB |
Output is correct |
47 |
Correct |
400 ms |
41680 KB |
Output is correct |
48 |
Correct |
6 ms |
9684 KB |
Output is correct |
49 |
Correct |
5 ms |
9660 KB |
Output is correct |
50 |
Correct |
5 ms |
9684 KB |
Output is correct |
51 |
Correct |
5 ms |
9684 KB |
Output is correct |
52 |
Correct |
6 ms |
9644 KB |
Output is correct |
53 |
Correct |
5 ms |
9684 KB |
Output is correct |
54 |
Correct |
6 ms |
9616 KB |
Output is correct |
55 |
Correct |
709 ms |
56788 KB |
Output is correct |
56 |
Correct |
5 ms |
9684 KB |
Output is correct |
57 |
Correct |
8 ms |
10068 KB |
Output is correct |
58 |
Correct |
15 ms |
11096 KB |
Output is correct |
59 |
Correct |
13 ms |
10904 KB |
Output is correct |
60 |
Correct |
297 ms |
33176 KB |
Output is correct |
61 |
Correct |
413 ms |
41228 KB |
Output is correct |
62 |
Correct |
564 ms |
48952 KB |
Output is correct |
63 |
Correct |
684 ms |
56724 KB |
Output is correct |
64 |
Correct |
5 ms |
9684 KB |
Output is correct |
65 |
Correct |
6 ms |
9684 KB |
Output is correct |
66 |
Correct |
5 ms |
9684 KB |
Output is correct |
67 |
Correct |
562 ms |
66072 KB |
Output is correct |
68 |
Correct |
637 ms |
66036 KB |
Output is correct |
69 |
Correct |
563 ms |
65768 KB |
Output is correct |
70 |
Correct |
7 ms |
10064 KB |
Output is correct |
71 |
Correct |
10 ms |
10528 KB |
Output is correct |
72 |
Correct |
255 ms |
32652 KB |
Output is correct |
73 |
Correct |
414 ms |
42084 KB |
Output is correct |
74 |
Correct |
608 ms |
55696 KB |
Output is correct |
75 |
Correct |
637 ms |
61624 KB |
Output is correct |
76 |
Correct |
589 ms |
66020 KB |
Output is correct |
77 |
Correct |
8 ms |
10196 KB |
Output is correct |
78 |
Correct |
11 ms |
10732 KB |
Output is correct |
79 |
Correct |
269 ms |
33712 KB |
Output is correct |
80 |
Correct |
416 ms |
43788 KB |
Output is correct |
81 |
Correct |
679 ms |
58236 KB |
Output is correct |
82 |
Correct |
5 ms |
9684 KB |
Output is correct |
83 |
Correct |
5 ms |
9712 KB |
Output is correct |
84 |
Correct |
6 ms |
9648 KB |
Output is correct |
85 |
Correct |
614 ms |
65416 KB |
Output is correct |
86 |
Correct |
637 ms |
56600 KB |
Output is correct |
87 |
Correct |
618 ms |
55576 KB |
Output is correct |
88 |
Correct |
459 ms |
62356 KB |
Output is correct |
89 |
Correct |
197 ms |
27704 KB |
Output is correct |
90 |
Correct |
294 ms |
33708 KB |
Output is correct |
91 |
Correct |
255 ms |
29420 KB |
Output is correct |
92 |
Correct |
627 ms |
66004 KB |
Output is correct |
93 |
Correct |
651 ms |
65952 KB |
Output is correct |
94 |
Correct |
661 ms |
71720 KB |
Output is correct |
95 |
Correct |
667 ms |
71940 KB |
Output is correct |
96 |
Correct |
5 ms |
9684 KB |
Output is correct |
97 |
Correct |
32 ms |
12972 KB |
Output is correct |
98 |
Correct |
73 ms |
18644 KB |
Output is correct |
99 |
Correct |
804 ms |
62852 KB |
Output is correct |
100 |
Correct |
13 ms |
10836 KB |
Output is correct |
101 |
Correct |
50 ms |
15132 KB |
Output is correct |
102 |
Correct |
109 ms |
20564 KB |
Output is correct |
103 |
Correct |
228 ms |
27492 KB |
Output is correct |
104 |
Correct |
302 ms |
34096 KB |
Output is correct |
105 |
Correct |
496 ms |
41148 KB |
Output is correct |
106 |
Correct |
718 ms |
47464 KB |
Output is correct |
107 |
Correct |
736 ms |
54296 KB |
Output is correct |
108 |
Correct |
5 ms |
9684 KB |
Output is correct |
109 |
Correct |
5 ms |
9684 KB |
Output is correct |
110 |
Correct |
6 ms |
9684 KB |
Output is correct |
111 |
Correct |
5 ms |
9684 KB |
Output is correct |
112 |
Correct |
6 ms |
9684 KB |
Output is correct |
113 |
Correct |
5 ms |
9616 KB |
Output is correct |
114 |
Correct |
5 ms |
9684 KB |
Output is correct |
115 |
Correct |
7 ms |
9684 KB |
Output is correct |
116 |
Correct |
5 ms |
9684 KB |
Output is correct |
117 |
Correct |
5 ms |
9684 KB |
Output is correct |
118 |
Correct |
5 ms |
9684 KB |
Output is correct |
119 |
Correct |
6 ms |
9812 KB |
Output is correct |
120 |
Correct |
6 ms |
9976 KB |
Output is correct |
121 |
Correct |
265 ms |
31828 KB |
Output is correct |
122 |
Correct |
442 ms |
41780 KB |
Output is correct |
123 |
Correct |
421 ms |
41728 KB |
Output is correct |
124 |
Correct |
6 ms |
9684 KB |
Output is correct |
125 |
Correct |
6 ms |
9724 KB |
Output is correct |
126 |
Correct |
5 ms |
9684 KB |
Output is correct |
127 |
Correct |
617 ms |
66016 KB |
Output is correct |
128 |
Correct |
583 ms |
66128 KB |
Output is correct |
129 |
Correct |
600 ms |
65748 KB |
Output is correct |
130 |
Correct |
8 ms |
10108 KB |
Output is correct |
131 |
Correct |
10 ms |
10580 KB |
Output is correct |
132 |
Correct |
237 ms |
32696 KB |
Output is correct |
133 |
Correct |
455 ms |
42236 KB |
Output is correct |
134 |
Correct |
616 ms |
55756 KB |
Output is correct |
135 |
Correct |
598 ms |
70988 KB |
Output is correct |
136 |
Correct |
562 ms |
71176 KB |
Output is correct |
137 |
Correct |
643 ms |
63684 KB |
Output is correct |
138 |
Correct |
707 ms |
55740 KB |
Output is correct |
139 |
Correct |
551 ms |
56668 KB |
Output is correct |
140 |
Correct |
5 ms |
9684 KB |
Output is correct |
141 |
Correct |
78 ms |
17068 KB |
Output is correct |
142 |
Correct |
29 ms |
11984 KB |
Output is correct |
143 |
Correct |
77 ms |
17788 KB |
Output is correct |
144 |
Correct |
139 ms |
23616 KB |
Output is correct |
145 |
Correct |
322 ms |
32928 KB |
Output is correct |
146 |
Correct |
354 ms |
38828 KB |
Output is correct |
147 |
Correct |
500 ms |
44684 KB |
Output is correct |
148 |
Correct |
620 ms |
50664 KB |
Output is correct |
149 |
Correct |
783 ms |
56272 KB |
Output is correct |
150 |
Correct |
635 ms |
61560 KB |
Output is correct |
151 |
Correct |
728 ms |
66012 KB |
Output is correct |
152 |
Correct |
8 ms |
10196 KB |
Output is correct |
153 |
Correct |
11 ms |
10680 KB |
Output is correct |
154 |
Correct |
290 ms |
33636 KB |
Output is correct |
155 |
Correct |
478 ms |
43884 KB |
Output is correct |
156 |
Correct |
797 ms |
58180 KB |
Output is correct |
157 |
Correct |
6 ms |
9684 KB |
Output is correct |
158 |
Correct |
5 ms |
9704 KB |
Output is correct |
159 |
Correct |
5 ms |
9684 KB |
Output is correct |
160 |
Correct |
5 ms |
9684 KB |
Output is correct |
161 |
Incorrect |
663 ms |
41872 KB |
Solution announced impossible, but it is possible. |
162 |
Halted |
0 ms |
0 KB |
- |