#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; });
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);
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: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 |
9684 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 |
9668 KB |
Output is correct |
9 |
Correct |
235 ms |
37828 KB |
Output is correct |
10 |
Correct |
18 ms |
12656 KB |
Output is correct |
11 |
Correct |
89 ms |
24848 KB |
Output is correct |
12 |
Correct |
27 ms |
14180 KB |
Output is correct |
13 |
Correct |
27 ms |
14228 KB |
Output is correct |
14 |
Correct |
7 ms |
9812 KB |
Output is correct |
15 |
Correct |
6 ms |
9812 KB |
Output is correct |
16 |
Correct |
282 ms |
37828 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 |
9684 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 |
9668 KB |
Output is correct |
9 |
Correct |
235 ms |
37828 KB |
Output is correct |
10 |
Correct |
18 ms |
12656 KB |
Output is correct |
11 |
Correct |
89 ms |
24848 KB |
Output is correct |
12 |
Correct |
27 ms |
14180 KB |
Output is correct |
13 |
Correct |
27 ms |
14228 KB |
Output is correct |
14 |
Correct |
7 ms |
9812 KB |
Output is correct |
15 |
Correct |
6 ms |
9812 KB |
Output is correct |
16 |
Correct |
282 ms |
37828 KB |
Output is correct |
17 |
Correct |
5 ms |
9684 KB |
Output is correct |
18 |
Correct |
6 ms |
9684 KB |
Output is correct |
19 |
Correct |
6 ms |
9632 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 |
806 ms |
59800 KB |
Output is correct |
24 |
Correct |
7 ms |
9688 KB |
Output is correct |
25 |
Correct |
8 ms |
10016 KB |
Output is correct |
26 |
Correct |
7 ms |
10068 KB |
Output is correct |
27 |
Correct |
7 ms |
10068 KB |
Output is correct |
28 |
Correct |
212 ms |
29576 KB |
Output is correct |
29 |
Correct |
337 ms |
39636 KB |
Output is correct |
30 |
Correct |
531 ms |
49780 KB |
Output is correct |
31 |
Correct |
796 ms |
59992 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 |
9724 KB |
Output is correct |
40 |
Correct |
5 ms |
9684 KB |
Output is correct |
41 |
Correct |
5 ms |
9684 KB |
Output is correct |
42 |
Correct |
5 ms |
9684 KB |
Output is correct |
43 |
Correct |
6 ms |
9940 KB |
Output is correct |
44 |
Correct |
7 ms |
9940 KB |
Output is correct |
45 |
Correct |
252 ms |
31768 KB |
Output is correct |
46 |
Correct |
475 ms |
41772 KB |
Output is correct |
47 |
Correct |
392 ms |
41676 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 |
9684 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 |
9668 KB |
Output is correct |
9 |
Correct |
235 ms |
37828 KB |
Output is correct |
10 |
Correct |
18 ms |
12656 KB |
Output is correct |
11 |
Correct |
89 ms |
24848 KB |
Output is correct |
12 |
Correct |
27 ms |
14180 KB |
Output is correct |
13 |
Correct |
27 ms |
14228 KB |
Output is correct |
14 |
Correct |
7 ms |
9812 KB |
Output is correct |
15 |
Correct |
6 ms |
9812 KB |
Output is correct |
16 |
Correct |
282 ms |
37828 KB |
Output is correct |
17 |
Correct |
5 ms |
9684 KB |
Output is correct |
18 |
Correct |
6 ms |
9684 KB |
Output is correct |
19 |
Correct |
6 ms |
9632 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 |
806 ms |
59800 KB |
Output is correct |
24 |
Correct |
7 ms |
9688 KB |
Output is correct |
25 |
Correct |
8 ms |
10016 KB |
Output is correct |
26 |
Correct |
7 ms |
10068 KB |
Output is correct |
27 |
Correct |
7 ms |
10068 KB |
Output is correct |
28 |
Correct |
212 ms |
29576 KB |
Output is correct |
29 |
Correct |
337 ms |
39636 KB |
Output is correct |
30 |
Correct |
531 ms |
49780 KB |
Output is correct |
31 |
Correct |
796 ms |
59992 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 |
9724 KB |
Output is correct |
40 |
Correct |
5 ms |
9684 KB |
Output is correct |
41 |
Correct |
5 ms |
9684 KB |
Output is correct |
42 |
Correct |
5 ms |
9684 KB |
Output is correct |
43 |
Correct |
6 ms |
9940 KB |
Output is correct |
44 |
Correct |
7 ms |
9940 KB |
Output is correct |
45 |
Correct |
252 ms |
31768 KB |
Output is correct |
46 |
Correct |
475 ms |
41772 KB |
Output is correct |
47 |
Correct |
392 ms |
41676 KB |
Output is correct |
48 |
Correct |
5 ms |
9684 KB |
Output is correct |
49 |
Correct |
13 ms |
9620 KB |
Output is correct |
50 |
Correct |
6 ms |
9684 KB |
Output is correct |
51 |
Correct |
6 ms |
9684 KB |
Output is correct |
52 |
Correct |
6 ms |
9684 KB |
Output is correct |
53 |
Correct |
5 ms |
9684 KB |
Output is correct |
54 |
Correct |
6 ms |
9684 KB |
Output is correct |
55 |
Correct |
689 ms |
57136 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 |
11108 KB |
Output is correct |
59 |
Correct |
12 ms |
10996 KB |
Output is correct |
60 |
Correct |
269 ms |
33564 KB |
Output is correct |
61 |
Correct |
422 ms |
41636 KB |
Output is correct |
62 |
Correct |
525 ms |
49332 KB |
Output is correct |
63 |
Correct |
739 ms |
57160 KB |
Output is correct |
64 |
Correct |
6 ms |
9684 KB |
Output is correct |
65 |
Correct |
6 ms |
9684 KB |
Output is correct |
66 |
Correct |
6 ms |
9620 KB |
Output is correct |
67 |
Correct |
643 ms |
66372 KB |
Output is correct |
68 |
Correct |
636 ms |
66384 KB |
Output is correct |
69 |
Correct |
582 ms |
66208 KB |
Output is correct |
70 |
Correct |
8 ms |
10196 KB |
Output is correct |
71 |
Correct |
12 ms |
10672 KB |
Output is correct |
72 |
Correct |
257 ms |
32968 KB |
Output is correct |
73 |
Correct |
424 ms |
42408 KB |
Output is correct |
74 |
Correct |
669 ms |
55992 KB |
Output is correct |
75 |
Correct |
654 ms |
61828 KB |
Output is correct |
76 |
Correct |
590 ms |
66240 KB |
Output is correct |
77 |
Correct |
9 ms |
10196 KB |
Output is correct |
78 |
Correct |
11 ms |
10708 KB |
Output is correct |
79 |
Correct |
244 ms |
34004 KB |
Output is correct |
80 |
Correct |
522 ms |
44092 KB |
Output is correct |
81 |
Correct |
741 ms |
58432 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 |
9684 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 |
9668 KB |
Output is correct |
9 |
Correct |
235 ms |
37828 KB |
Output is correct |
10 |
Correct |
18 ms |
12656 KB |
Output is correct |
11 |
Correct |
89 ms |
24848 KB |
Output is correct |
12 |
Correct |
27 ms |
14180 KB |
Output is correct |
13 |
Correct |
27 ms |
14228 KB |
Output is correct |
14 |
Correct |
7 ms |
9812 KB |
Output is correct |
15 |
Correct |
6 ms |
9812 KB |
Output is correct |
16 |
Correct |
282 ms |
37828 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 |
9700 KB |
Output is correct |
20 |
Correct |
624 ms |
65488 KB |
Output is correct |
21 |
Correct |
733 ms |
56768 KB |
Output is correct |
22 |
Correct |
705 ms |
55676 KB |
Output is correct |
23 |
Correct |
472 ms |
62432 KB |
Output is correct |
24 |
Correct |
199 ms |
27796 KB |
Output is correct |
25 |
Correct |
247 ms |
33860 KB |
Output is correct |
26 |
Correct |
249 ms |
29544 KB |
Output is correct |
27 |
Correct |
707 ms |
66048 KB |
Output is correct |
28 |
Correct |
736 ms |
66044 KB |
Output is correct |
29 |
Correct |
662 ms |
71876 KB |
Output is correct |
30 |
Correct |
741 ms |
71828 KB |
Output is correct |
31 |
Correct |
5 ms |
9684 KB |
Output is correct |
32 |
Correct |
31 ms |
13152 KB |
Output is correct |
33 |
Correct |
75 ms |
18836 KB |
Output is correct |
34 |
Correct |
578 ms |
62944 KB |
Output is correct |
35 |
Correct |
15 ms |
11000 KB |
Output is correct |
36 |
Correct |
52 ms |
15136 KB |
Output is correct |
37 |
Correct |
109 ms |
20728 KB |
Output is correct |
38 |
Correct |
200 ms |
27580 KB |
Output is correct |
39 |
Correct |
310 ms |
34208 KB |
Output is correct |
40 |
Correct |
427 ms |
41296 KB |
Output is correct |
41 |
Correct |
515 ms |
47476 KB |
Output is correct |
42 |
Correct |
786 ms |
54444 KB |
Output is correct |
43 |
Correct |
5 ms |
9684 KB |
Output is correct |
44 |
Correct |
5 ms |
9704 KB |
Output is correct |
45 |
Correct |
6 ms |
9704 KB |
Output is correct |
46 |
Correct |
5 ms |
9700 KB |
Output is correct |
47 |
Correct |
6 ms |
9632 KB |
Output is correct |
48 |
Correct |
5 ms |
9700 KB |
Output is correct |
49 |
Correct |
5 ms |
9704 KB |
Output is correct |
50 |
Correct |
7 ms |
9684 KB |
Output is correct |
51 |
Correct |
6 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 |
9832 KB |
Output is correct |
55 |
Correct |
7 ms |
9952 KB |
Output is correct |
56 |
Correct |
235 ms |
31892 KB |
Output is correct |
57 |
Correct |
401 ms |
41860 KB |
Output is correct |
58 |
Correct |
452 ms |
41900 KB |
Output is correct |
59 |
Correct |
7 ms |
9684 KB |
Output is correct |
60 |
Correct |
5 ms |
9684 KB |
Output is correct |
61 |
Correct |
5 ms |
9684 KB |
Output is correct |
62 |
Correct |
669 ms |
66116 KB |
Output is correct |
63 |
Correct |
613 ms |
66116 KB |
Output is correct |
64 |
Correct |
554 ms |
65972 KB |
Output is correct |
65 |
Correct |
8 ms |
10196 KB |
Output is correct |
66 |
Correct |
12 ms |
10680 KB |
Output is correct |
67 |
Correct |
242 ms |
32856 KB |
Output is correct |
68 |
Correct |
422 ms |
42296 KB |
Output is correct |
69 |
Correct |
620 ms |
55840 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 |
9684 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 |
9668 KB |
Output is correct |
9 |
Correct |
235 ms |
37828 KB |
Output is correct |
10 |
Correct |
18 ms |
12656 KB |
Output is correct |
11 |
Correct |
89 ms |
24848 KB |
Output is correct |
12 |
Correct |
27 ms |
14180 KB |
Output is correct |
13 |
Correct |
27 ms |
14228 KB |
Output is correct |
14 |
Correct |
7 ms |
9812 KB |
Output is correct |
15 |
Correct |
6 ms |
9812 KB |
Output is correct |
16 |
Correct |
282 ms |
37828 KB |
Output is correct |
17 |
Correct |
537 ms |
70940 KB |
Output is correct |
18 |
Correct |
574 ms |
71320 KB |
Output is correct |
19 |
Correct |
628 ms |
65736 KB |
Output is correct |
20 |
Correct |
668 ms |
55848 KB |
Output is correct |
21 |
Correct |
554 ms |
56980 KB |
Output is correct |
22 |
Correct |
6 ms |
9684 KB |
Output is correct |
23 |
Correct |
70 ms |
17284 KB |
Output is correct |
24 |
Correct |
25 ms |
12116 KB |
Output is correct |
25 |
Correct |
81 ms |
17888 KB |
Output is correct |
26 |
Correct |
135 ms |
23852 KB |
Output is correct |
27 |
Correct |
258 ms |
33072 KB |
Output is correct |
28 |
Correct |
365 ms |
39056 KB |
Output is correct |
29 |
Correct |
473 ms |
44824 KB |
Output is correct |
30 |
Correct |
601 ms |
50632 KB |
Output is correct |
31 |
Correct |
677 ms |
56424 KB |
Output is correct |
32 |
Correct |
656 ms |
61720 KB |
Output is correct |
33 |
Correct |
600 ms |
66168 KB |
Output is correct |
34 |
Correct |
8 ms |
10196 KB |
Output is correct |
35 |
Correct |
11 ms |
10756 KB |
Output is correct |
36 |
Correct |
276 ms |
33808 KB |
Output is correct |
37 |
Correct |
448 ms |
43984 KB |
Output is correct |
38 |
Correct |
744 ms |
58328 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 |
9684 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 |
9668 KB |
Output is correct |
9 |
Correct |
235 ms |
37828 KB |
Output is correct |
10 |
Correct |
18 ms |
12656 KB |
Output is correct |
11 |
Correct |
89 ms |
24848 KB |
Output is correct |
12 |
Correct |
27 ms |
14180 KB |
Output is correct |
13 |
Correct |
27 ms |
14228 KB |
Output is correct |
14 |
Correct |
7 ms |
9812 KB |
Output is correct |
15 |
Correct |
6 ms |
9812 KB |
Output is correct |
16 |
Correct |
282 ms |
37828 KB |
Output is correct |
17 |
Correct |
5 ms |
9684 KB |
Output is correct |
18 |
Correct |
6 ms |
9684 KB |
Output is correct |
19 |
Correct |
6 ms |
9632 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 |
806 ms |
59800 KB |
Output is correct |
24 |
Correct |
7 ms |
9688 KB |
Output is correct |
25 |
Correct |
8 ms |
10016 KB |
Output is correct |
26 |
Correct |
7 ms |
10068 KB |
Output is correct |
27 |
Correct |
7 ms |
10068 KB |
Output is correct |
28 |
Correct |
212 ms |
29576 KB |
Output is correct |
29 |
Correct |
337 ms |
39636 KB |
Output is correct |
30 |
Correct |
531 ms |
49780 KB |
Output is correct |
31 |
Correct |
796 ms |
59992 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 |
9724 KB |
Output is correct |
40 |
Correct |
5 ms |
9684 KB |
Output is correct |
41 |
Correct |
5 ms |
9684 KB |
Output is correct |
42 |
Correct |
5 ms |
9684 KB |
Output is correct |
43 |
Correct |
6 ms |
9940 KB |
Output is correct |
44 |
Correct |
7 ms |
9940 KB |
Output is correct |
45 |
Correct |
252 ms |
31768 KB |
Output is correct |
46 |
Correct |
475 ms |
41772 KB |
Output is correct |
47 |
Correct |
392 ms |
41676 KB |
Output is correct |
48 |
Correct |
5 ms |
9684 KB |
Output is correct |
49 |
Correct |
13 ms |
9620 KB |
Output is correct |
50 |
Correct |
6 ms |
9684 KB |
Output is correct |
51 |
Correct |
6 ms |
9684 KB |
Output is correct |
52 |
Correct |
6 ms |
9684 KB |
Output is correct |
53 |
Correct |
5 ms |
9684 KB |
Output is correct |
54 |
Correct |
6 ms |
9684 KB |
Output is correct |
55 |
Correct |
689 ms |
57136 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 |
11108 KB |
Output is correct |
59 |
Correct |
12 ms |
10996 KB |
Output is correct |
60 |
Correct |
269 ms |
33564 KB |
Output is correct |
61 |
Correct |
422 ms |
41636 KB |
Output is correct |
62 |
Correct |
525 ms |
49332 KB |
Output is correct |
63 |
Correct |
739 ms |
57160 KB |
Output is correct |
64 |
Correct |
6 ms |
9684 KB |
Output is correct |
65 |
Correct |
6 ms |
9684 KB |
Output is correct |
66 |
Correct |
6 ms |
9620 KB |
Output is correct |
67 |
Correct |
643 ms |
66372 KB |
Output is correct |
68 |
Correct |
636 ms |
66384 KB |
Output is correct |
69 |
Correct |
582 ms |
66208 KB |
Output is correct |
70 |
Correct |
8 ms |
10196 KB |
Output is correct |
71 |
Correct |
12 ms |
10672 KB |
Output is correct |
72 |
Correct |
257 ms |
32968 KB |
Output is correct |
73 |
Correct |
424 ms |
42408 KB |
Output is correct |
74 |
Correct |
669 ms |
55992 KB |
Output is correct |
75 |
Correct |
654 ms |
61828 KB |
Output is correct |
76 |
Correct |
590 ms |
66240 KB |
Output is correct |
77 |
Correct |
9 ms |
10196 KB |
Output is correct |
78 |
Correct |
11 ms |
10708 KB |
Output is correct |
79 |
Correct |
244 ms |
34004 KB |
Output is correct |
80 |
Correct |
522 ms |
44092 KB |
Output is correct |
81 |
Correct |
741 ms |
58432 KB |
Output is correct |
82 |
Correct |
5 ms |
9684 KB |
Output is correct |
83 |
Correct |
6 ms |
9684 KB |
Output is correct |
84 |
Correct |
5 ms |
9700 KB |
Output is correct |
85 |
Correct |
624 ms |
65488 KB |
Output is correct |
86 |
Correct |
733 ms |
56768 KB |
Output is correct |
87 |
Correct |
705 ms |
55676 KB |
Output is correct |
88 |
Correct |
472 ms |
62432 KB |
Output is correct |
89 |
Correct |
199 ms |
27796 KB |
Output is correct |
90 |
Correct |
247 ms |
33860 KB |
Output is correct |
91 |
Correct |
249 ms |
29544 KB |
Output is correct |
92 |
Correct |
707 ms |
66048 KB |
Output is correct |
93 |
Correct |
736 ms |
66044 KB |
Output is correct |
94 |
Correct |
662 ms |
71876 KB |
Output is correct |
95 |
Correct |
741 ms |
71828 KB |
Output is correct |
96 |
Correct |
5 ms |
9684 KB |
Output is correct |
97 |
Correct |
31 ms |
13152 KB |
Output is correct |
98 |
Correct |
75 ms |
18836 KB |
Output is correct |
99 |
Correct |
578 ms |
62944 KB |
Output is correct |
100 |
Correct |
15 ms |
11000 KB |
Output is correct |
101 |
Correct |
52 ms |
15136 KB |
Output is correct |
102 |
Correct |
109 ms |
20728 KB |
Output is correct |
103 |
Correct |
200 ms |
27580 KB |
Output is correct |
104 |
Correct |
310 ms |
34208 KB |
Output is correct |
105 |
Correct |
427 ms |
41296 KB |
Output is correct |
106 |
Correct |
515 ms |
47476 KB |
Output is correct |
107 |
Correct |
786 ms |
54444 KB |
Output is correct |
108 |
Correct |
5 ms |
9684 KB |
Output is correct |
109 |
Correct |
5 ms |
9704 KB |
Output is correct |
110 |
Correct |
6 ms |
9704 KB |
Output is correct |
111 |
Correct |
5 ms |
9700 KB |
Output is correct |
112 |
Correct |
6 ms |
9632 KB |
Output is correct |
113 |
Correct |
5 ms |
9700 KB |
Output is correct |
114 |
Correct |
5 ms |
9704 KB |
Output is correct |
115 |
Correct |
7 ms |
9684 KB |
Output is correct |
116 |
Correct |
6 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 |
9832 KB |
Output is correct |
120 |
Correct |
7 ms |
9952 KB |
Output is correct |
121 |
Correct |
235 ms |
31892 KB |
Output is correct |
122 |
Correct |
401 ms |
41860 KB |
Output is correct |
123 |
Correct |
452 ms |
41900 KB |
Output is correct |
124 |
Correct |
7 ms |
9684 KB |
Output is correct |
125 |
Correct |
5 ms |
9684 KB |
Output is correct |
126 |
Correct |
5 ms |
9684 KB |
Output is correct |
127 |
Correct |
669 ms |
66116 KB |
Output is correct |
128 |
Correct |
613 ms |
66116 KB |
Output is correct |
129 |
Correct |
554 ms |
65972 KB |
Output is correct |
130 |
Correct |
8 ms |
10196 KB |
Output is correct |
131 |
Correct |
12 ms |
10680 KB |
Output is correct |
132 |
Correct |
242 ms |
32856 KB |
Output is correct |
133 |
Correct |
422 ms |
42296 KB |
Output is correct |
134 |
Correct |
620 ms |
55840 KB |
Output is correct |
135 |
Correct |
537 ms |
70940 KB |
Output is correct |
136 |
Correct |
574 ms |
71320 KB |
Output is correct |
137 |
Correct |
628 ms |
65736 KB |
Output is correct |
138 |
Correct |
668 ms |
55848 KB |
Output is correct |
139 |
Correct |
554 ms |
56980 KB |
Output is correct |
140 |
Correct |
6 ms |
9684 KB |
Output is correct |
141 |
Correct |
70 ms |
17284 KB |
Output is correct |
142 |
Correct |
25 ms |
12116 KB |
Output is correct |
143 |
Correct |
81 ms |
17888 KB |
Output is correct |
144 |
Correct |
135 ms |
23852 KB |
Output is correct |
145 |
Correct |
258 ms |
33072 KB |
Output is correct |
146 |
Correct |
365 ms |
39056 KB |
Output is correct |
147 |
Correct |
473 ms |
44824 KB |
Output is correct |
148 |
Correct |
601 ms |
50632 KB |
Output is correct |
149 |
Correct |
677 ms |
56424 KB |
Output is correct |
150 |
Correct |
656 ms |
61720 KB |
Output is correct |
151 |
Correct |
600 ms |
66168 KB |
Output is correct |
152 |
Correct |
8 ms |
10196 KB |
Output is correct |
153 |
Correct |
11 ms |
10756 KB |
Output is correct |
154 |
Correct |
276 ms |
33808 KB |
Output is correct |
155 |
Correct |
448 ms |
43984 KB |
Output is correct |
156 |
Correct |
744 ms |
58328 KB |
Output is correct |
157 |
Correct |
5 ms |
9684 KB |
Output is correct |
158 |
Correct |
6 ms |
9684 KB |
Output is correct |
159 |
Correct |
5 ms |
9700 KB |
Output is correct |
160 |
Correct |
6 ms |
9688 KB |
Output is correct |
161 |
Runtime error |
825 ms |
85696 KB |
Execution killed with signal 6 |
162 |
Halted |
0 ms |
0 KB |
- |