#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);
else if(v != p)
hmm++;
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; });
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);
assert(hmm <= 2);
}
build(ru, rv, bx, by);
return 1;
}
Compilation message
parks.cpp: In function 'int construct_roads(std::vector<int>, std::vector<int>)':
parks.cpp:106:19: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
106 | if (ru.size() < n - 1)
| ~~~~~~~~~~^~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
9684 KB |
Output is correct |
2 |
Correct |
5 ms |
9708 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 |
9684 KB |
Output is correct |
6 |
Correct |
5 ms |
9612 KB |
Output is correct |
7 |
Correct |
5 ms |
9704 KB |
Output is correct |
8 |
Correct |
5 ms |
9700 KB |
Output is correct |
9 |
Correct |
259 ms |
38000 KB |
Output is correct |
10 |
Correct |
18 ms |
12796 KB |
Output is correct |
11 |
Correct |
90 ms |
24960 KB |
Output is correct |
12 |
Correct |
29 ms |
14316 KB |
Output is correct |
13 |
Correct |
28 ms |
14388 KB |
Output is correct |
14 |
Correct |
6 ms |
9780 KB |
Output is correct |
15 |
Correct |
7 ms |
9868 KB |
Output is correct |
16 |
Correct |
273 ms |
38024 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
9684 KB |
Output is correct |
2 |
Correct |
5 ms |
9708 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 |
9684 KB |
Output is correct |
6 |
Correct |
5 ms |
9612 KB |
Output is correct |
7 |
Correct |
5 ms |
9704 KB |
Output is correct |
8 |
Correct |
5 ms |
9700 KB |
Output is correct |
9 |
Correct |
259 ms |
38000 KB |
Output is correct |
10 |
Correct |
18 ms |
12796 KB |
Output is correct |
11 |
Correct |
90 ms |
24960 KB |
Output is correct |
12 |
Correct |
29 ms |
14316 KB |
Output is correct |
13 |
Correct |
28 ms |
14388 KB |
Output is correct |
14 |
Correct |
6 ms |
9780 KB |
Output is correct |
15 |
Correct |
7 ms |
9868 KB |
Output is correct |
16 |
Correct |
273 ms |
38024 KB |
Output is correct |
17 |
Correct |
5 ms |
9700 KB |
Output is correct |
18 |
Correct |
5 ms |
9684 KB |
Output is correct |
19 |
Correct |
5 ms |
9684 KB |
Output is correct |
20 |
Correct |
5 ms |
9684 KB |
Output is correct |
21 |
Correct |
5 ms |
9684 KB |
Output is correct |
22 |
Correct |
5 ms |
9684 KB |
Output is correct |
23 |
Correct |
788 ms |
60172 KB |
Output is correct |
24 |
Correct |
5 ms |
9684 KB |
Output is correct |
25 |
Correct |
7 ms |
9976 KB |
Output is correct |
26 |
Correct |
9 ms |
10068 KB |
Output is correct |
27 |
Correct |
8 ms |
10148 KB |
Output is correct |
28 |
Correct |
216 ms |
29696 KB |
Output is correct |
29 |
Correct |
363 ms |
39820 KB |
Output is correct |
30 |
Correct |
587 ms |
49900 KB |
Output is correct |
31 |
Correct |
774 ms |
60192 KB |
Output is correct |
32 |
Correct |
5 ms |
9684 KB |
Output is correct |
33 |
Correct |
5 ms |
9684 KB |
Output is correct |
34 |
Correct |
6 ms |
9684 KB |
Output is correct |
35 |
Correct |
6 ms |
9684 KB |
Output is correct |
36 |
Correct |
5 ms |
9704 KB |
Output is correct |
37 |
Correct |
5 ms |
9700 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 |
5 ms |
9700 KB |
Output is correct |
42 |
Correct |
5 ms |
9684 KB |
Output is correct |
43 |
Correct |
9 ms |
9940 KB |
Output is correct |
44 |
Correct |
8 ms |
9968 KB |
Output is correct |
45 |
Correct |
229 ms |
31952 KB |
Output is correct |
46 |
Correct |
459 ms |
42024 KB |
Output is correct |
47 |
Correct |
440 ms |
41936 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
9684 KB |
Output is correct |
2 |
Correct |
5 ms |
9708 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 |
9684 KB |
Output is correct |
6 |
Correct |
5 ms |
9612 KB |
Output is correct |
7 |
Correct |
5 ms |
9704 KB |
Output is correct |
8 |
Correct |
5 ms |
9700 KB |
Output is correct |
9 |
Correct |
259 ms |
38000 KB |
Output is correct |
10 |
Correct |
18 ms |
12796 KB |
Output is correct |
11 |
Correct |
90 ms |
24960 KB |
Output is correct |
12 |
Correct |
29 ms |
14316 KB |
Output is correct |
13 |
Correct |
28 ms |
14388 KB |
Output is correct |
14 |
Correct |
6 ms |
9780 KB |
Output is correct |
15 |
Correct |
7 ms |
9868 KB |
Output is correct |
16 |
Correct |
273 ms |
38024 KB |
Output is correct |
17 |
Correct |
5 ms |
9700 KB |
Output is correct |
18 |
Correct |
5 ms |
9684 KB |
Output is correct |
19 |
Correct |
5 ms |
9684 KB |
Output is correct |
20 |
Correct |
5 ms |
9684 KB |
Output is correct |
21 |
Correct |
5 ms |
9684 KB |
Output is correct |
22 |
Correct |
5 ms |
9684 KB |
Output is correct |
23 |
Correct |
788 ms |
60172 KB |
Output is correct |
24 |
Correct |
5 ms |
9684 KB |
Output is correct |
25 |
Correct |
7 ms |
9976 KB |
Output is correct |
26 |
Correct |
9 ms |
10068 KB |
Output is correct |
27 |
Correct |
8 ms |
10148 KB |
Output is correct |
28 |
Correct |
216 ms |
29696 KB |
Output is correct |
29 |
Correct |
363 ms |
39820 KB |
Output is correct |
30 |
Correct |
587 ms |
49900 KB |
Output is correct |
31 |
Correct |
774 ms |
60192 KB |
Output is correct |
32 |
Correct |
5 ms |
9684 KB |
Output is correct |
33 |
Correct |
5 ms |
9684 KB |
Output is correct |
34 |
Correct |
6 ms |
9684 KB |
Output is correct |
35 |
Correct |
6 ms |
9684 KB |
Output is correct |
36 |
Correct |
5 ms |
9704 KB |
Output is correct |
37 |
Correct |
5 ms |
9700 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 |
5 ms |
9700 KB |
Output is correct |
42 |
Correct |
5 ms |
9684 KB |
Output is correct |
43 |
Correct |
9 ms |
9940 KB |
Output is correct |
44 |
Correct |
8 ms |
9968 KB |
Output is correct |
45 |
Correct |
229 ms |
31952 KB |
Output is correct |
46 |
Correct |
459 ms |
42024 KB |
Output is correct |
47 |
Correct |
440 ms |
41936 KB |
Output is correct |
48 |
Correct |
6 ms |
9684 KB |
Output is correct |
49 |
Correct |
5 ms |
9704 KB |
Output is correct |
50 |
Correct |
6 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 |
6 ms |
9684 KB |
Output is correct |
54 |
Correct |
5 ms |
9684 KB |
Output is correct |
55 |
Correct |
749 ms |
56932 KB |
Output is correct |
56 |
Correct |
5 ms |
9684 KB |
Output is correct |
57 |
Correct |
8 ms |
10124 KB |
Output is correct |
58 |
Correct |
15 ms |
11092 KB |
Output is correct |
59 |
Correct |
14 ms |
10988 KB |
Output is correct |
60 |
Correct |
283 ms |
33288 KB |
Output is correct |
61 |
Correct |
462 ms |
41500 KB |
Output is correct |
62 |
Correct |
567 ms |
49184 KB |
Output is correct |
63 |
Correct |
806 ms |
57128 KB |
Output is correct |
64 |
Correct |
5 ms |
9684 KB |
Output is correct |
65 |
Correct |
5 ms |
9652 KB |
Output is correct |
66 |
Correct |
5 ms |
9684 KB |
Output is correct |
67 |
Correct |
668 ms |
66240 KB |
Output is correct |
68 |
Correct |
617 ms |
66332 KB |
Output is correct |
69 |
Correct |
616 ms |
66084 KB |
Output is correct |
70 |
Correct |
9 ms |
10196 KB |
Output is correct |
71 |
Correct |
11 ms |
10580 KB |
Output is correct |
72 |
Correct |
246 ms |
32852 KB |
Output is correct |
73 |
Correct |
432 ms |
42460 KB |
Output is correct |
74 |
Correct |
644 ms |
56076 KB |
Output is correct |
75 |
Correct |
729 ms |
61808 KB |
Output is correct |
76 |
Correct |
628 ms |
66368 KB |
Output is correct |
77 |
Correct |
9 ms |
10196 KB |
Output is correct |
78 |
Correct |
14 ms |
10744 KB |
Output is correct |
79 |
Correct |
314 ms |
33828 KB |
Output is correct |
80 |
Correct |
455 ms |
44008 KB |
Output is correct |
81 |
Correct |
680 ms |
58444 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
9684 KB |
Output is correct |
2 |
Correct |
5 ms |
9708 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 |
9684 KB |
Output is correct |
6 |
Correct |
5 ms |
9612 KB |
Output is correct |
7 |
Correct |
5 ms |
9704 KB |
Output is correct |
8 |
Correct |
5 ms |
9700 KB |
Output is correct |
9 |
Correct |
259 ms |
38000 KB |
Output is correct |
10 |
Correct |
18 ms |
12796 KB |
Output is correct |
11 |
Correct |
90 ms |
24960 KB |
Output is correct |
12 |
Correct |
29 ms |
14316 KB |
Output is correct |
13 |
Correct |
28 ms |
14388 KB |
Output is correct |
14 |
Correct |
6 ms |
9780 KB |
Output is correct |
15 |
Correct |
7 ms |
9868 KB |
Output is correct |
16 |
Correct |
273 ms |
38024 KB |
Output is correct |
17 |
Correct |
5 ms |
9684 KB |
Output is correct |
18 |
Correct |
5 ms |
9684 KB |
Output is correct |
19 |
Correct |
5 ms |
9704 KB |
Output is correct |
20 |
Correct |
608 ms |
65476 KB |
Output is correct |
21 |
Correct |
613 ms |
56900 KB |
Output is correct |
22 |
Correct |
594 ms |
55988 KB |
Output is correct |
23 |
Correct |
480 ms |
62472 KB |
Output is correct |
24 |
Correct |
278 ms |
29356 KB |
Output is correct |
25 |
Correct |
327 ms |
35204 KB |
Output is correct |
26 |
Correct |
278 ms |
30992 KB |
Output is correct |
27 |
Correct |
822 ms |
66232 KB |
Output is correct |
28 |
Correct |
774 ms |
66212 KB |
Output is correct |
29 |
Correct |
528 ms |
71924 KB |
Output is correct |
30 |
Correct |
580 ms |
72028 KB |
Output is correct |
31 |
Correct |
6 ms |
9684 KB |
Output is correct |
32 |
Correct |
30 ms |
13144 KB |
Output is correct |
33 |
Correct |
78 ms |
19968 KB |
Output is correct |
34 |
Correct |
618 ms |
63132 KB |
Output is correct |
35 |
Correct |
13 ms |
10964 KB |
Output is correct |
36 |
Correct |
57 ms |
15716 KB |
Output is correct |
37 |
Correct |
126 ms |
21888 KB |
Output is correct |
38 |
Correct |
220 ms |
27680 KB |
Output is correct |
39 |
Correct |
281 ms |
34220 KB |
Output is correct |
40 |
Correct |
386 ms |
41436 KB |
Output is correct |
41 |
Correct |
485 ms |
47712 KB |
Output is correct |
42 |
Correct |
673 ms |
54692 KB |
Output is correct |
43 |
Correct |
5 ms |
9684 KB |
Output is correct |
44 |
Correct |
6 ms |
9684 KB |
Output is correct |
45 |
Correct |
5 ms |
9684 KB |
Output is correct |
46 |
Correct |
5 ms |
9620 KB |
Output is correct |
47 |
Correct |
5 ms |
9708 KB |
Output is correct |
48 |
Correct |
5 ms |
9700 KB |
Output is correct |
49 |
Correct |
5 ms |
9684 KB |
Output is correct |
50 |
Correct |
5 ms |
9712 KB |
Output is correct |
51 |
Correct |
5 ms |
9684 KB |
Output is correct |
52 |
Correct |
5 ms |
9696 KB |
Output is correct |
53 |
Correct |
5 ms |
9708 KB |
Output is correct |
54 |
Correct |
6 ms |
9940 KB |
Output is correct |
55 |
Correct |
7 ms |
10064 KB |
Output is correct |
56 |
Correct |
247 ms |
31916 KB |
Output is correct |
57 |
Correct |
443 ms |
41960 KB |
Output is correct |
58 |
Correct |
407 ms |
41940 KB |
Output is correct |
59 |
Correct |
6 ms |
9700 KB |
Output is correct |
60 |
Correct |
6 ms |
9704 KB |
Output is correct |
61 |
Correct |
6 ms |
9704 KB |
Output is correct |
62 |
Correct |
594 ms |
66276 KB |
Output is correct |
63 |
Correct |
615 ms |
66396 KB |
Output is correct |
64 |
Correct |
565 ms |
66048 KB |
Output is correct |
65 |
Correct |
8 ms |
10068 KB |
Output is correct |
66 |
Correct |
10 ms |
10580 KB |
Output is correct |
67 |
Correct |
237 ms |
32816 KB |
Output is correct |
68 |
Correct |
404 ms |
42356 KB |
Output is correct |
69 |
Correct |
629 ms |
56120 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
9684 KB |
Output is correct |
2 |
Correct |
5 ms |
9708 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 |
9684 KB |
Output is correct |
6 |
Correct |
5 ms |
9612 KB |
Output is correct |
7 |
Correct |
5 ms |
9704 KB |
Output is correct |
8 |
Correct |
5 ms |
9700 KB |
Output is correct |
9 |
Correct |
259 ms |
38000 KB |
Output is correct |
10 |
Correct |
18 ms |
12796 KB |
Output is correct |
11 |
Correct |
90 ms |
24960 KB |
Output is correct |
12 |
Correct |
29 ms |
14316 KB |
Output is correct |
13 |
Correct |
28 ms |
14388 KB |
Output is correct |
14 |
Correct |
6 ms |
9780 KB |
Output is correct |
15 |
Correct |
7 ms |
9868 KB |
Output is correct |
16 |
Correct |
273 ms |
38024 KB |
Output is correct |
17 |
Correct |
502 ms |
71108 KB |
Output is correct |
18 |
Correct |
590 ms |
71160 KB |
Output is correct |
19 |
Correct |
584 ms |
61912 KB |
Output is correct |
20 |
Correct |
671 ms |
55972 KB |
Output is correct |
21 |
Correct |
507 ms |
59432 KB |
Output is correct |
22 |
Correct |
5 ms |
9812 KB |
Output is correct |
23 |
Correct |
71 ms |
17564 KB |
Output is correct |
24 |
Correct |
23 ms |
12244 KB |
Output is correct |
25 |
Correct |
76 ms |
18648 KB |
Output is correct |
26 |
Correct |
142 ms |
25204 KB |
Output is correct |
27 |
Correct |
241 ms |
33360 KB |
Output is correct |
28 |
Correct |
340 ms |
39268 KB |
Output is correct |
29 |
Correct |
435 ms |
45160 KB |
Output is correct |
30 |
Correct |
559 ms |
51080 KB |
Output is correct |
31 |
Correct |
662 ms |
56856 KB |
Output is correct |
32 |
Correct |
620 ms |
61884 KB |
Output is correct |
33 |
Correct |
621 ms |
66412 KB |
Output is correct |
34 |
Correct |
8 ms |
10292 KB |
Output is correct |
35 |
Correct |
11 ms |
10744 KB |
Output is correct |
36 |
Correct |
237 ms |
33924 KB |
Output is correct |
37 |
Correct |
459 ms |
44116 KB |
Output is correct |
38 |
Correct |
683 ms |
58388 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
9684 KB |
Output is correct |
2 |
Correct |
5 ms |
9708 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 |
9684 KB |
Output is correct |
6 |
Correct |
5 ms |
9612 KB |
Output is correct |
7 |
Correct |
5 ms |
9704 KB |
Output is correct |
8 |
Correct |
5 ms |
9700 KB |
Output is correct |
9 |
Correct |
259 ms |
38000 KB |
Output is correct |
10 |
Correct |
18 ms |
12796 KB |
Output is correct |
11 |
Correct |
90 ms |
24960 KB |
Output is correct |
12 |
Correct |
29 ms |
14316 KB |
Output is correct |
13 |
Correct |
28 ms |
14388 KB |
Output is correct |
14 |
Correct |
6 ms |
9780 KB |
Output is correct |
15 |
Correct |
7 ms |
9868 KB |
Output is correct |
16 |
Correct |
273 ms |
38024 KB |
Output is correct |
17 |
Correct |
5 ms |
9700 KB |
Output is correct |
18 |
Correct |
5 ms |
9684 KB |
Output is correct |
19 |
Correct |
5 ms |
9684 KB |
Output is correct |
20 |
Correct |
5 ms |
9684 KB |
Output is correct |
21 |
Correct |
5 ms |
9684 KB |
Output is correct |
22 |
Correct |
5 ms |
9684 KB |
Output is correct |
23 |
Correct |
788 ms |
60172 KB |
Output is correct |
24 |
Correct |
5 ms |
9684 KB |
Output is correct |
25 |
Correct |
7 ms |
9976 KB |
Output is correct |
26 |
Correct |
9 ms |
10068 KB |
Output is correct |
27 |
Correct |
8 ms |
10148 KB |
Output is correct |
28 |
Correct |
216 ms |
29696 KB |
Output is correct |
29 |
Correct |
363 ms |
39820 KB |
Output is correct |
30 |
Correct |
587 ms |
49900 KB |
Output is correct |
31 |
Correct |
774 ms |
60192 KB |
Output is correct |
32 |
Correct |
5 ms |
9684 KB |
Output is correct |
33 |
Correct |
5 ms |
9684 KB |
Output is correct |
34 |
Correct |
6 ms |
9684 KB |
Output is correct |
35 |
Correct |
6 ms |
9684 KB |
Output is correct |
36 |
Correct |
5 ms |
9704 KB |
Output is correct |
37 |
Correct |
5 ms |
9700 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 |
5 ms |
9700 KB |
Output is correct |
42 |
Correct |
5 ms |
9684 KB |
Output is correct |
43 |
Correct |
9 ms |
9940 KB |
Output is correct |
44 |
Correct |
8 ms |
9968 KB |
Output is correct |
45 |
Correct |
229 ms |
31952 KB |
Output is correct |
46 |
Correct |
459 ms |
42024 KB |
Output is correct |
47 |
Correct |
440 ms |
41936 KB |
Output is correct |
48 |
Correct |
6 ms |
9684 KB |
Output is correct |
49 |
Correct |
5 ms |
9704 KB |
Output is correct |
50 |
Correct |
6 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 |
6 ms |
9684 KB |
Output is correct |
54 |
Correct |
5 ms |
9684 KB |
Output is correct |
55 |
Correct |
749 ms |
56932 KB |
Output is correct |
56 |
Correct |
5 ms |
9684 KB |
Output is correct |
57 |
Correct |
8 ms |
10124 KB |
Output is correct |
58 |
Correct |
15 ms |
11092 KB |
Output is correct |
59 |
Correct |
14 ms |
10988 KB |
Output is correct |
60 |
Correct |
283 ms |
33288 KB |
Output is correct |
61 |
Correct |
462 ms |
41500 KB |
Output is correct |
62 |
Correct |
567 ms |
49184 KB |
Output is correct |
63 |
Correct |
806 ms |
57128 KB |
Output is correct |
64 |
Correct |
5 ms |
9684 KB |
Output is correct |
65 |
Correct |
5 ms |
9652 KB |
Output is correct |
66 |
Correct |
5 ms |
9684 KB |
Output is correct |
67 |
Correct |
668 ms |
66240 KB |
Output is correct |
68 |
Correct |
617 ms |
66332 KB |
Output is correct |
69 |
Correct |
616 ms |
66084 KB |
Output is correct |
70 |
Correct |
9 ms |
10196 KB |
Output is correct |
71 |
Correct |
11 ms |
10580 KB |
Output is correct |
72 |
Correct |
246 ms |
32852 KB |
Output is correct |
73 |
Correct |
432 ms |
42460 KB |
Output is correct |
74 |
Correct |
644 ms |
56076 KB |
Output is correct |
75 |
Correct |
729 ms |
61808 KB |
Output is correct |
76 |
Correct |
628 ms |
66368 KB |
Output is correct |
77 |
Correct |
9 ms |
10196 KB |
Output is correct |
78 |
Correct |
14 ms |
10744 KB |
Output is correct |
79 |
Correct |
314 ms |
33828 KB |
Output is correct |
80 |
Correct |
455 ms |
44008 KB |
Output is correct |
81 |
Correct |
680 ms |
58444 KB |
Output is correct |
82 |
Correct |
5 ms |
9684 KB |
Output is correct |
83 |
Correct |
5 ms |
9684 KB |
Output is correct |
84 |
Correct |
5 ms |
9704 KB |
Output is correct |
85 |
Correct |
608 ms |
65476 KB |
Output is correct |
86 |
Correct |
613 ms |
56900 KB |
Output is correct |
87 |
Correct |
594 ms |
55988 KB |
Output is correct |
88 |
Correct |
480 ms |
62472 KB |
Output is correct |
89 |
Correct |
278 ms |
29356 KB |
Output is correct |
90 |
Correct |
327 ms |
35204 KB |
Output is correct |
91 |
Correct |
278 ms |
30992 KB |
Output is correct |
92 |
Correct |
822 ms |
66232 KB |
Output is correct |
93 |
Correct |
774 ms |
66212 KB |
Output is correct |
94 |
Correct |
528 ms |
71924 KB |
Output is correct |
95 |
Correct |
580 ms |
72028 KB |
Output is correct |
96 |
Correct |
6 ms |
9684 KB |
Output is correct |
97 |
Correct |
30 ms |
13144 KB |
Output is correct |
98 |
Correct |
78 ms |
19968 KB |
Output is correct |
99 |
Correct |
618 ms |
63132 KB |
Output is correct |
100 |
Correct |
13 ms |
10964 KB |
Output is correct |
101 |
Correct |
57 ms |
15716 KB |
Output is correct |
102 |
Correct |
126 ms |
21888 KB |
Output is correct |
103 |
Correct |
220 ms |
27680 KB |
Output is correct |
104 |
Correct |
281 ms |
34220 KB |
Output is correct |
105 |
Correct |
386 ms |
41436 KB |
Output is correct |
106 |
Correct |
485 ms |
47712 KB |
Output is correct |
107 |
Correct |
673 ms |
54692 KB |
Output is correct |
108 |
Correct |
5 ms |
9684 KB |
Output is correct |
109 |
Correct |
6 ms |
9684 KB |
Output is correct |
110 |
Correct |
5 ms |
9684 KB |
Output is correct |
111 |
Correct |
5 ms |
9620 KB |
Output is correct |
112 |
Correct |
5 ms |
9708 KB |
Output is correct |
113 |
Correct |
5 ms |
9700 KB |
Output is correct |
114 |
Correct |
5 ms |
9684 KB |
Output is correct |
115 |
Correct |
5 ms |
9712 KB |
Output is correct |
116 |
Correct |
5 ms |
9684 KB |
Output is correct |
117 |
Correct |
5 ms |
9696 KB |
Output is correct |
118 |
Correct |
5 ms |
9708 KB |
Output is correct |
119 |
Correct |
6 ms |
9940 KB |
Output is correct |
120 |
Correct |
7 ms |
10064 KB |
Output is correct |
121 |
Correct |
247 ms |
31916 KB |
Output is correct |
122 |
Correct |
443 ms |
41960 KB |
Output is correct |
123 |
Correct |
407 ms |
41940 KB |
Output is correct |
124 |
Correct |
6 ms |
9700 KB |
Output is correct |
125 |
Correct |
6 ms |
9704 KB |
Output is correct |
126 |
Correct |
6 ms |
9704 KB |
Output is correct |
127 |
Correct |
594 ms |
66276 KB |
Output is correct |
128 |
Correct |
615 ms |
66396 KB |
Output is correct |
129 |
Correct |
565 ms |
66048 KB |
Output is correct |
130 |
Correct |
8 ms |
10068 KB |
Output is correct |
131 |
Correct |
10 ms |
10580 KB |
Output is correct |
132 |
Correct |
237 ms |
32816 KB |
Output is correct |
133 |
Correct |
404 ms |
42356 KB |
Output is correct |
134 |
Correct |
629 ms |
56120 KB |
Output is correct |
135 |
Correct |
502 ms |
71108 KB |
Output is correct |
136 |
Correct |
590 ms |
71160 KB |
Output is correct |
137 |
Correct |
584 ms |
61912 KB |
Output is correct |
138 |
Correct |
671 ms |
55972 KB |
Output is correct |
139 |
Correct |
507 ms |
59432 KB |
Output is correct |
140 |
Correct |
5 ms |
9812 KB |
Output is correct |
141 |
Correct |
71 ms |
17564 KB |
Output is correct |
142 |
Correct |
23 ms |
12244 KB |
Output is correct |
143 |
Correct |
76 ms |
18648 KB |
Output is correct |
144 |
Correct |
142 ms |
25204 KB |
Output is correct |
145 |
Correct |
241 ms |
33360 KB |
Output is correct |
146 |
Correct |
340 ms |
39268 KB |
Output is correct |
147 |
Correct |
435 ms |
45160 KB |
Output is correct |
148 |
Correct |
559 ms |
51080 KB |
Output is correct |
149 |
Correct |
662 ms |
56856 KB |
Output is correct |
150 |
Correct |
620 ms |
61884 KB |
Output is correct |
151 |
Correct |
621 ms |
66412 KB |
Output is correct |
152 |
Correct |
8 ms |
10292 KB |
Output is correct |
153 |
Correct |
11 ms |
10744 KB |
Output is correct |
154 |
Correct |
237 ms |
33924 KB |
Output is correct |
155 |
Correct |
459 ms |
44116 KB |
Output is correct |
156 |
Correct |
683 ms |
58388 KB |
Output is correct |
157 |
Correct |
5 ms |
9684 KB |
Output is correct |
158 |
Correct |
5 ms |
9684 KB |
Output is correct |
159 |
Correct |
5 ms |
9700 KB |
Output is correct |
160 |
Correct |
5 ms |
9684 KB |
Output is correct |
161 |
Correct |
775 ms |
51376 KB |
Output is correct |
162 |
Correct |
562 ms |
65028 KB |
Output is correct |
163 |
Correct |
607 ms |
53980 KB |
Output is correct |
164 |
Correct |
585 ms |
54196 KB |
Output is correct |
165 |
Correct |
680 ms |
52372 KB |
Output is correct |
166 |
Correct |
708 ms |
51780 KB |
Output is correct |
167 |
Runtime error |
110 ms |
35788 KB |
Execution killed with signal 6 |
168 |
Halted |
0 ms |
0 KB |
- |