Submission #1068772

# Submission time Handle Problem Language Result Execution time Memory
1068772 2024-08-21T12:00:23 Z Boas Fountain Parks (IOI21_parks) C++17
70 / 100
429 ms 77304 KB
#include "parks.h"

#pragma GCC optimize("trapv")

#include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef long long ll;
typedef vector<signed> vi32;
typedef vector<bool> vb;
typedef vector<vi> vvi;
typedef unordered_set<ll> si;
typedef pair<int, int> ii;
typedef tuple<int, int, int> iii;
typedef vector<ii> vii;
typedef set<iii> siii;
// typedef unordered_set<ii> sii;
typedef vector<vii> vvii;
#define pb push_back
#define loop(x, i) for (int i = 0; i < x; i++)
#define ALL(x) begin(x), end(x)
#define sz(x) (int)x.size()

vii adj = {{-2, 0}, {2, 0}, {0, 2}, {0, -2}};

vector<si> benchPoints(4); // neighbour count

ll MX = 200'002;

ll toInt(ii p)
{
    auto [b, c] = p;
    return MX * b + c;
}

void addNeighbour(ll x, ll y, int dif = 1)
{
    if (benchPoints[1].count(toInt({x, y})))
    {
        benchPoints[1].erase(toInt({x, y}));
        if (dif == 1)
        {
            benchPoints[2].insert(toInt({x, y}));
        }
    }
    else if (benchPoints[2].count(toInt({x, y})))
    {
        benchPoints[2].erase(toInt({x, y}));
        benchPoints[2 + dif].insert(toInt({x, y}));
    }
    else if (benchPoints[3].count(toInt({x, y})))
    {
        benchPoints[3].erase(toInt({x, y}));
        if (dif == 1)
            throw;
        benchPoints[2].insert(toInt({x, y}));
    }
    else if (dif == 1)
    {
        benchPoints[1].insert(toInt({x, y}));
    }
}

int construct_roads(vi xs, vi ys)
{
    unordered_map<ll, int> fountains;
    unordered_map<ll, int> roads;
    // unordered_set<ii> gotBench;
    int n = sz(xs);
    loop(n, i)
    {
        fountains[toInt({xs[i], ys[i]})] = i;
    }
    vb vis(n);
    vi u, v, a, b;
    a = b = vi(n - 1);
    int visCnt = 1;
    auto dfs = [&](auto &&self, int i) -> void
    {
        int x = xs[i], y = ys[i];
        for (const auto &[dx, dy] : adj)
        {
            ii pos = {x + dx, y + dy};
            if (fountains.count(toInt(pos)))
            {
                int j = fountains[toInt(pos)];
                if (vis[j])
                    continue;
                if (dx != 0)
                {
                    roads[toInt({x + dx / 2, y})] = sz(u);
                    addNeighbour(x + dx / 2, y + 1);
                    addNeighbour(x + dx / 2, y - 1);
                }
                else
                {
                    roads[toInt({x, y + dy / 2})] = sz(u);
                    addNeighbour(x + 1, y + dy / 2);
                    addNeighbour(x - 1, y + dy / 2);
                }
                u.pb(i);
                v.pb(j);
                vis[j] = 1;
                visCnt++;
                self(self, j);
            }
        }
    };
    vis[0] = 1;
    dfs(dfs, 0);
    if (visCnt != n)
        return 0;
    for (int benchesBuilt = 0; benchesBuilt < n - 1; benchesBuilt++)
    {
        ll x, y;
        for (int i = 1; i <= 3; i++)
        {
            if (!benchPoints[i].empty())
            {
                ll pr = *benchPoints[i].begin();
                x = pr / MX, y = pr % MX;
                benchPoints[i].erase(benchPoints[i].begin());
                break;
            }
        }
        ii loc;
        if (roads.count(toInt({x + 1, y})))
        {
            loc = {x + 1, y};
            addNeighbour(x + 2, y, -1);
        }
        else if (roads.count(toInt({x - 1, y})))
        {
            loc = {x - 1, y};
            addNeighbour(x - 2, y, -1);
        }
        else if (roads.count(toInt({x, y + 1})))
        {
            loc = {x, y + 1};
            addNeighbour(x, y + 2, -1);
        }
        else
        {
            loc = {x, y - 1};
            addNeighbour(x, y - 2, -1);
        }
        int ix = roads[toInt(loc)];
        roads.erase(toInt(loc));
        a[ix] = x;
        b[ix] = y;
    }
    build(u, v, a, b);
    return 1;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 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 148 ms 37316 KB Output is correct
10 Correct 15 ms 4112 KB Output is correct
11 Correct 65 ms 20684 KB Output is correct
12 Correct 18 ms 5812 KB Output is correct
13 Correct 29 ms 12660 KB Output is correct
14 Correct 1 ms 604 KB Output is correct
15 Correct 1 ms 604 KB Output is correct
16 Correct 132 ms 30276 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 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 148 ms 37316 KB Output is correct
10 Correct 15 ms 4112 KB Output is correct
11 Correct 65 ms 20684 KB Output is correct
12 Correct 18 ms 5812 KB Output is correct
13 Correct 29 ms 12660 KB Output is correct
14 Correct 1 ms 604 KB Output is correct
15 Correct 1 ms 604 KB Output is correct
16 Correct 132 ms 30276 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 348 KB Output is correct
20 Correct 0 ms 348 KB Output is correct
21 Correct 0 ms 348 KB Output is correct
22 Correct 1 ms 348 KB Output is correct
23 Correct 353 ms 65664 KB Output is correct
24 Correct 0 ms 344 KB Output is correct
25 Correct 2 ms 604 KB Output is correct
26 Correct 2 ms 860 KB Output is correct
27 Correct 2 ms 604 KB Output is correct
28 Correct 121 ms 26472 KB Output is correct
29 Correct 210 ms 36544 KB Output is correct
30 Correct 258 ms 51004 KB Output is correct
31 Correct 350 ms 62460 KB Output is correct
32 Correct 0 ms 344 KB Output is correct
33 Correct 0 ms 348 KB Output is correct
34 Correct 1 ms 348 KB Output is correct
35 Correct 0 ms 348 KB Output is correct
36 Correct 0 ms 348 KB Output is correct
37 Correct 1 ms 344 KB Output is correct
38 Correct 0 ms 348 KB Output is correct
39 Correct 0 ms 600 KB Output is correct
40 Correct 0 ms 348 KB Output is correct
41 Correct 0 ms 348 KB Output is correct
42 Correct 1 ms 348 KB Output is correct
43 Correct 2 ms 604 KB Output is correct
44 Correct 1 ms 604 KB Output is correct
45 Correct 181 ms 28724 KB Output is correct
46 Correct 266 ms 42692 KB Output is correct
47 Correct 262 ms 41552 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 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 148 ms 37316 KB Output is correct
10 Correct 15 ms 4112 KB Output is correct
11 Correct 65 ms 20684 KB Output is correct
12 Correct 18 ms 5812 KB Output is correct
13 Correct 29 ms 12660 KB Output is correct
14 Correct 1 ms 604 KB Output is correct
15 Correct 1 ms 604 KB Output is correct
16 Correct 132 ms 30276 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 348 KB Output is correct
20 Correct 0 ms 348 KB Output is correct
21 Correct 0 ms 348 KB Output is correct
22 Correct 1 ms 348 KB Output is correct
23 Correct 353 ms 65664 KB Output is correct
24 Correct 0 ms 344 KB Output is correct
25 Correct 2 ms 604 KB Output is correct
26 Correct 2 ms 860 KB Output is correct
27 Correct 2 ms 604 KB Output is correct
28 Correct 121 ms 26472 KB Output is correct
29 Correct 210 ms 36544 KB Output is correct
30 Correct 258 ms 51004 KB Output is correct
31 Correct 350 ms 62460 KB Output is correct
32 Correct 0 ms 344 KB Output is correct
33 Correct 0 ms 348 KB Output is correct
34 Correct 1 ms 348 KB Output is correct
35 Correct 0 ms 348 KB Output is correct
36 Correct 0 ms 348 KB Output is correct
37 Correct 1 ms 344 KB Output is correct
38 Correct 0 ms 348 KB Output is correct
39 Correct 0 ms 600 KB Output is correct
40 Correct 0 ms 348 KB Output is correct
41 Correct 0 ms 348 KB Output is correct
42 Correct 1 ms 348 KB Output is correct
43 Correct 2 ms 604 KB Output is correct
44 Correct 1 ms 604 KB Output is correct
45 Correct 181 ms 28724 KB Output is correct
46 Correct 266 ms 42692 KB Output is correct
47 Correct 262 ms 41552 KB Output is correct
48 Correct 0 ms 348 KB Output is correct
49 Correct 0 ms 348 KB Output is correct
50 Correct 0 ms 348 KB Output is correct
51 Correct 0 ms 348 KB Output is correct
52 Correct 0 ms 344 KB Output is correct
53 Correct 0 ms 348 KB Output is correct
54 Correct 0 ms 348 KB Output is correct
55 Correct 362 ms 59092 KB Output is correct
56 Correct 0 ms 348 KB Output is correct
57 Correct 3 ms 860 KB Output is correct
58 Correct 9 ms 2416 KB Output is correct
59 Correct 4 ms 1372 KB Output is correct
60 Correct 148 ms 33348 KB Output is correct
61 Correct 247 ms 43456 KB Output is correct
62 Correct 298 ms 48844 KB Output is correct
63 Correct 383 ms 57728 KB Output is correct
64 Correct 1 ms 344 KB Output is correct
65 Correct 0 ms 348 KB Output is correct
66 Correct 0 ms 348 KB Output is correct
67 Correct 293 ms 68456 KB Output is correct
68 Correct 300 ms 67784 KB Output is correct
69 Correct 295 ms 71364 KB Output is correct
70 Correct 3 ms 856 KB Output is correct
71 Correct 4 ms 1116 KB Output is correct
72 Correct 177 ms 24028 KB Output is correct
73 Correct 273 ms 39360 KB Output is correct
74 Correct 389 ms 47720 KB Output is correct
75 Correct 406 ms 63044 KB Output is correct
76 Correct 304 ms 77252 KB Output is correct
77 Correct 3 ms 1112 KB Output is correct
78 Correct 6 ms 1808 KB Output is correct
79 Correct 170 ms 27192 KB Output is correct
80 Correct 296 ms 41124 KB Output is correct
81 Correct 405 ms 55680 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 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 148 ms 37316 KB Output is correct
10 Correct 15 ms 4112 KB Output is correct
11 Correct 65 ms 20684 KB Output is correct
12 Correct 18 ms 5812 KB Output is correct
13 Correct 29 ms 12660 KB Output is correct
14 Correct 1 ms 604 KB Output is correct
15 Correct 1 ms 604 KB Output is correct
16 Correct 132 ms 30276 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 404 KB Output is correct
20 Correct 321 ms 68216 KB Output is correct
21 Correct 326 ms 61696 KB Output is correct
22 Correct 335 ms 57724 KB Output is correct
23 Correct 333 ms 51112 KB Output is correct
24 Correct 61 ms 14084 KB Output is correct
25 Correct 55 ms 14068 KB Output is correct
26 Correct 57 ms 14116 KB Output is correct
27 Correct 330 ms 44416 KB Output is correct
28 Correct 303 ms 44280 KB Output is correct
29 Correct 365 ms 44288 KB Output is correct
30 Correct 354 ms 44416 KB Output is correct
31 Correct 1 ms 348 KB Output is correct
32 Correct 25 ms 3740 KB Output is correct
33 Correct 27 ms 7116 KB Output is correct
34 Correct 429 ms 62720 KB Output is correct
35 Correct 7 ms 1372 KB Output is correct
36 Correct 24 ms 4964 KB Output is correct
37 Correct 43 ms 8392 KB Output is correct
38 Correct 141 ms 13372 KB Output is correct
39 Correct 208 ms 19656 KB Output is correct
40 Correct 299 ms 23932 KB Output is correct
41 Correct 423 ms 27600 KB Output is correct
42 Correct 413 ms 34256 KB Output is correct
43 Correct 0 ms 344 KB Output is correct
44 Correct 1 ms 348 KB Output is correct
45 Correct 0 ms 348 KB Output is correct
46 Correct 0 ms 348 KB Output is correct
47 Correct 1 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 1 ms 348 KB Output is correct
51 Correct 0 ms 348 KB Output is correct
52 Correct 0 ms 348 KB Output is correct
53 Correct 0 ms 344 KB Output is correct
54 Correct 1 ms 604 KB Output is correct
55 Correct 1 ms 604 KB Output is correct
56 Correct 181 ms 28724 KB Output is correct
57 Correct 271 ms 42692 KB Output is correct
58 Correct 272 ms 41668 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 348 KB Output is correct
62 Correct 305 ms 68492 KB Output is correct
63 Correct 293 ms 67856 KB Output is correct
64 Correct 317 ms 71368 KB Output is correct
65 Correct 3 ms 860 KB Output is correct
66 Correct 4 ms 1116 KB Output is correct
67 Correct 176 ms 23900 KB Output is correct
68 Correct 277 ms 39368 KB Output is correct
69 Correct 386 ms 47740 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 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 148 ms 37316 KB Output is correct
10 Correct 15 ms 4112 KB Output is correct
11 Correct 65 ms 20684 KB Output is correct
12 Correct 18 ms 5812 KB Output is correct
13 Correct 29 ms 12660 KB Output is correct
14 Correct 1 ms 604 KB Output is correct
15 Correct 1 ms 604 KB Output is correct
16 Correct 132 ms 30276 KB Output is correct
17 Correct 408 ms 77304 KB Output is correct
18 Correct 403 ms 73796 KB Output is correct
19 Correct 393 ms 68988 KB Output is correct
20 Correct 385 ms 57208 KB Output is correct
21 Correct 382 ms 48988 KB Output is correct
22 Correct 1 ms 344 KB Output is correct
23 Correct 56 ms 6956 KB Output is correct
24 Correct 15 ms 3224 KB Output is correct
25 Correct 34 ms 7020 KB Output is correct
26 Correct 56 ms 10380 KB Output is correct
27 Correct 187 ms 25028 KB Output is correct
28 Correct 274 ms 31716 KB Output is correct
29 Correct 331 ms 37568 KB Output is correct
30 Correct 343 ms 46456 KB Output is correct
31 Correct 420 ms 50556 KB Output is correct
32 Correct 370 ms 63180 KB Output is correct
33 Correct 282 ms 77272 KB Output is correct
34 Correct 4 ms 1112 KB Output is correct
35 Correct 5 ms 1808 KB Output is correct
36 Correct 160 ms 27080 KB Output is correct
37 Correct 282 ms 41156 KB Output is correct
38 Correct 429 ms 55804 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 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 148 ms 37316 KB Output is correct
10 Correct 15 ms 4112 KB Output is correct
11 Correct 65 ms 20684 KB Output is correct
12 Correct 18 ms 5812 KB Output is correct
13 Correct 29 ms 12660 KB Output is correct
14 Correct 1 ms 604 KB Output is correct
15 Correct 1 ms 604 KB Output is correct
16 Correct 132 ms 30276 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 348 KB Output is correct
20 Correct 0 ms 348 KB Output is correct
21 Correct 0 ms 348 KB Output is correct
22 Correct 1 ms 348 KB Output is correct
23 Correct 353 ms 65664 KB Output is correct
24 Correct 0 ms 344 KB Output is correct
25 Correct 2 ms 604 KB Output is correct
26 Correct 2 ms 860 KB Output is correct
27 Correct 2 ms 604 KB Output is correct
28 Correct 121 ms 26472 KB Output is correct
29 Correct 210 ms 36544 KB Output is correct
30 Correct 258 ms 51004 KB Output is correct
31 Correct 350 ms 62460 KB Output is correct
32 Correct 0 ms 344 KB Output is correct
33 Correct 0 ms 348 KB Output is correct
34 Correct 1 ms 348 KB Output is correct
35 Correct 0 ms 348 KB Output is correct
36 Correct 0 ms 348 KB Output is correct
37 Correct 1 ms 344 KB Output is correct
38 Correct 0 ms 348 KB Output is correct
39 Correct 0 ms 600 KB Output is correct
40 Correct 0 ms 348 KB Output is correct
41 Correct 0 ms 348 KB Output is correct
42 Correct 1 ms 348 KB Output is correct
43 Correct 2 ms 604 KB Output is correct
44 Correct 1 ms 604 KB Output is correct
45 Correct 181 ms 28724 KB Output is correct
46 Correct 266 ms 42692 KB Output is correct
47 Correct 262 ms 41552 KB Output is correct
48 Correct 0 ms 348 KB Output is correct
49 Correct 0 ms 348 KB Output is correct
50 Correct 0 ms 348 KB Output is correct
51 Correct 0 ms 348 KB Output is correct
52 Correct 0 ms 344 KB Output is correct
53 Correct 0 ms 348 KB Output is correct
54 Correct 0 ms 348 KB Output is correct
55 Correct 362 ms 59092 KB Output is correct
56 Correct 0 ms 348 KB Output is correct
57 Correct 3 ms 860 KB Output is correct
58 Correct 9 ms 2416 KB Output is correct
59 Correct 4 ms 1372 KB Output is correct
60 Correct 148 ms 33348 KB Output is correct
61 Correct 247 ms 43456 KB Output is correct
62 Correct 298 ms 48844 KB Output is correct
63 Correct 383 ms 57728 KB Output is correct
64 Correct 1 ms 344 KB Output is correct
65 Correct 0 ms 348 KB Output is correct
66 Correct 0 ms 348 KB Output is correct
67 Correct 293 ms 68456 KB Output is correct
68 Correct 300 ms 67784 KB Output is correct
69 Correct 295 ms 71364 KB Output is correct
70 Correct 3 ms 856 KB Output is correct
71 Correct 4 ms 1116 KB Output is correct
72 Correct 177 ms 24028 KB Output is correct
73 Correct 273 ms 39360 KB Output is correct
74 Correct 389 ms 47720 KB Output is correct
75 Correct 406 ms 63044 KB Output is correct
76 Correct 304 ms 77252 KB Output is correct
77 Correct 3 ms 1112 KB Output is correct
78 Correct 6 ms 1808 KB Output is correct
79 Correct 170 ms 27192 KB Output is correct
80 Correct 296 ms 41124 KB Output is correct
81 Correct 405 ms 55680 KB Output is correct
82 Correct 0 ms 344 KB Output is correct
83 Correct 0 ms 348 KB Output is correct
84 Correct 0 ms 404 KB Output is correct
85 Correct 321 ms 68216 KB Output is correct
86 Correct 326 ms 61696 KB Output is correct
87 Correct 335 ms 57724 KB Output is correct
88 Correct 333 ms 51112 KB Output is correct
89 Correct 61 ms 14084 KB Output is correct
90 Correct 55 ms 14068 KB Output is correct
91 Correct 57 ms 14116 KB Output is correct
92 Correct 330 ms 44416 KB Output is correct
93 Correct 303 ms 44280 KB Output is correct
94 Correct 365 ms 44288 KB Output is correct
95 Correct 354 ms 44416 KB Output is correct
96 Correct 1 ms 348 KB Output is correct
97 Correct 25 ms 3740 KB Output is correct
98 Correct 27 ms 7116 KB Output is correct
99 Correct 429 ms 62720 KB Output is correct
100 Correct 7 ms 1372 KB Output is correct
101 Correct 24 ms 4964 KB Output is correct
102 Correct 43 ms 8392 KB Output is correct
103 Correct 141 ms 13372 KB Output is correct
104 Correct 208 ms 19656 KB Output is correct
105 Correct 299 ms 23932 KB Output is correct
106 Correct 423 ms 27600 KB Output is correct
107 Correct 413 ms 34256 KB Output is correct
108 Correct 0 ms 344 KB Output is correct
109 Correct 1 ms 348 KB Output is correct
110 Correct 0 ms 348 KB Output is correct
111 Correct 0 ms 348 KB Output is correct
112 Correct 1 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 1 ms 348 KB Output is correct
116 Correct 0 ms 348 KB Output is correct
117 Correct 0 ms 348 KB Output is correct
118 Correct 0 ms 344 KB Output is correct
119 Correct 1 ms 604 KB Output is correct
120 Correct 1 ms 604 KB Output is correct
121 Correct 181 ms 28724 KB Output is correct
122 Correct 271 ms 42692 KB Output is correct
123 Correct 272 ms 41668 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 348 KB Output is correct
127 Correct 305 ms 68492 KB Output is correct
128 Correct 293 ms 67856 KB Output is correct
129 Correct 317 ms 71368 KB Output is correct
130 Correct 3 ms 860 KB Output is correct
131 Correct 4 ms 1116 KB Output is correct
132 Correct 176 ms 23900 KB Output is correct
133 Correct 277 ms 39368 KB Output is correct
134 Correct 386 ms 47740 KB Output is correct
135 Correct 408 ms 77304 KB Output is correct
136 Correct 403 ms 73796 KB Output is correct
137 Correct 393 ms 68988 KB Output is correct
138 Correct 385 ms 57208 KB Output is correct
139 Correct 382 ms 48988 KB Output is correct
140 Correct 1 ms 344 KB Output is correct
141 Correct 56 ms 6956 KB Output is correct
142 Correct 15 ms 3224 KB Output is correct
143 Correct 34 ms 7020 KB Output is correct
144 Correct 56 ms 10380 KB Output is correct
145 Correct 187 ms 25028 KB Output is correct
146 Correct 274 ms 31716 KB Output is correct
147 Correct 331 ms 37568 KB Output is correct
148 Correct 343 ms 46456 KB Output is correct
149 Correct 420 ms 50556 KB Output is correct
150 Correct 370 ms 63180 KB Output is correct
151 Correct 282 ms 77272 KB Output is correct
152 Correct 4 ms 1112 KB Output is correct
153 Correct 5 ms 1808 KB Output is correct
154 Correct 160 ms 27080 KB Output is correct
155 Correct 282 ms 41156 KB Output is correct
156 Correct 429 ms 55804 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 365 ms 55724 KB Output is correct
162 Correct 312 ms 57468 KB Output is correct
163 Correct 309 ms 48000 KB Output is correct
164 Correct 306 ms 47484 KB Output is correct
165 Correct 369 ms 63868 KB Output is correct
166 Correct 383 ms 68168 KB Output is correct
167 Incorrect 77 ms 9824 KB Tree (a[0], b[0]) = (185669, 21655) is not adjacent to edge between u[0]=0 @(185612, 20720) and v[0]=20200 @(185610, 20720)
168 Halted 0 ms 0 KB -