Submission #435237

# Submission time Handle Problem Language Result Execution time Memory
435237 2021-06-23T05:57:16 Z ecnerwala Fountain Parks (IOI21_parks) C++17
100 / 100
226 ms 17600 KB
#include "parks.h"

#include <bits/stdc++.h>

int construct_roads(std::vector<int> X, std::vector<int> Y) {
    int N = int(X.size());
    struct pt_t {
        int x, y, idx;
    };

    std::vector<pt_t> pts(N);
    for (int i = 0; i < N; i++) pts[i] = {X[i], Y[i], i};

    std::vector<int> north(N, -1);
    std::vector<int> east(N, -1);

    std::vector<int> par(N, -1);
    auto get_par = [&](int a) -> int {
        while (par[a] >= 0) {
            if (par[par[a]] >= 0) par[a] = par[par[a]];
            a = par[a];
        }
        return a;
    };
    auto merge = [&](int a, int b) -> bool {
        a = get_par(a), b = get_par(b);
        if (a == b) return false;
        if (par[a] > par[b]) std::swap(a, b);
        par[a] += par[b];
        par[b] = a;
        return true;
    };

    std::sort(pts.begin(), pts.end(), [](pt_t a, pt_t b) { return std::tie(a.x, a.y) < std::tie(b.x, b.y); });
    for (int i = 0; i+1 < N; i++) {
        if (pts[i].x == pts[i+1].x && pts[i].y + 2 == pts[i+1].y) {
            north[pts[i].idx] = pts[i+1].idx;
        }
    }

    std::sort(pts.begin(), pts.end(), [](pt_t a, pt_t b) { return std::tie(a.y, a.x) < std::tie(b.y, b.x); });
    for (int i = 0; i+1 < N; i++) {
        if (pts[i].y == pts[i+1].y && pts[i].x + 2 == pts[i+1].x) {
            east[pts[i].idx] = pts[i+1].idx;
        }
    }

    std::vector<int> U, V, A, B; U.reserve(N-1), V.reserve(N-1), A.reserve(N-1), B.reserve(N-1);

    for (int i = 0; i < N; i++) {
        bool is_full = east[i] != -1 && north[i] != -1 && north[east[i]] != -1;

        if (east[i] != -1) {
            if ((X[i]^Y[i])&2) {
                // We use below us
                if (merge(i, east[i])) {
                    U.push_back(i);
                    V.push_back(east[i]);
                    A.push_back(X[i]+1);
                    B.push_back(Y[i]-1);
                }
            } else {
                // We use above of us, and we're not preferred
                if (!is_full) {
                    if (merge(i, east[i])) {
                        U.push_back(i);
                        V.push_back(east[i]);
                        A.push_back(X[i]+1);
                        B.push_back(Y[i]+1);
                    }
                }
            }
        }
        if (north[i] != -1) {
            if ((X[i]^Y[i])&2) {
                // We use right of us, and we're not preferred
                if (!is_full) {
                    if (merge(i, north[i])) {
                        U.push_back(i);
                        V.push_back(north[i]);
                        A.push_back(X[i]+1);
                        B.push_back(Y[i]+1);
                    }
                }
            } else {
                // We use left of us
                if (merge(i, north[i])) {
                    U.push_back(i);
                    V.push_back(north[i]);
                    A.push_back(X[i]-1);
                    B.push_back(Y[i]+1);
                }
            }
        }
    }

    if (int(U.size()) != N-1) return false;
    build(U, V, A, B); return true;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 256 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 80 ms 8884 KB Output is correct
10 Correct 7 ms 1228 KB Output is correct
11 Correct 38 ms 4948 KB Output is correct
12 Correct 10 ms 1692 KB Output is correct
13 Correct 14 ms 2692 KB Output is correct
14 Correct 1 ms 332 KB Output is correct
15 Correct 1 ms 332 KB Output is correct
16 Correct 88 ms 8820 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 256 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 80 ms 8884 KB Output is correct
10 Correct 7 ms 1228 KB Output is correct
11 Correct 38 ms 4948 KB Output is correct
12 Correct 10 ms 1692 KB Output is correct
13 Correct 14 ms 2692 KB Output is correct
14 Correct 1 ms 332 KB Output is correct
15 Correct 1 ms 332 KB Output is correct
16 Correct 88 ms 8820 KB Output is correct
17 Correct 1 ms 204 KB Output is correct
18 Correct 1 ms 204 KB Output is correct
19 Correct 1 ms 204 KB Output is correct
20 Correct 1 ms 204 KB Output is correct
21 Correct 1 ms 204 KB Output is correct
22 Correct 1 ms 204 KB Output is correct
23 Correct 181 ms 17476 KB Output is correct
24 Correct 1 ms 204 KB Output is correct
25 Correct 2 ms 332 KB Output is correct
26 Correct 2 ms 332 KB Output is correct
27 Correct 2 ms 460 KB Output is correct
28 Correct 68 ms 7164 KB Output is correct
29 Correct 114 ms 10568 KB Output is correct
30 Correct 165 ms 14096 KB Output is correct
31 Correct 193 ms 17468 KB Output is correct
32 Correct 1 ms 204 KB Output is correct
33 Correct 1 ms 204 KB Output is correct
34 Correct 1 ms 204 KB Output is correct
35 Correct 1 ms 204 KB Output is correct
36 Correct 1 ms 204 KB Output is correct
37 Correct 1 ms 204 KB Output is correct
38 Correct 1 ms 204 KB Output is correct
39 Correct 1 ms 204 KB Output is correct
40 Correct 1 ms 204 KB Output is correct
41 Correct 1 ms 204 KB Output is correct
42 Correct 1 ms 204 KB Output is correct
43 Correct 1 ms 332 KB Output is correct
44 Correct 3 ms 332 KB Output is correct
45 Correct 111 ms 8844 KB Output is correct
46 Correct 123 ms 12740 KB Output is correct
47 Correct 123 ms 12740 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 256 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 80 ms 8884 KB Output is correct
10 Correct 7 ms 1228 KB Output is correct
11 Correct 38 ms 4948 KB Output is correct
12 Correct 10 ms 1692 KB Output is correct
13 Correct 14 ms 2692 KB Output is correct
14 Correct 1 ms 332 KB Output is correct
15 Correct 1 ms 332 KB Output is correct
16 Correct 88 ms 8820 KB Output is correct
17 Correct 1 ms 204 KB Output is correct
18 Correct 1 ms 204 KB Output is correct
19 Correct 1 ms 204 KB Output is correct
20 Correct 1 ms 204 KB Output is correct
21 Correct 1 ms 204 KB Output is correct
22 Correct 1 ms 204 KB Output is correct
23 Correct 181 ms 17476 KB Output is correct
24 Correct 1 ms 204 KB Output is correct
25 Correct 2 ms 332 KB Output is correct
26 Correct 2 ms 332 KB Output is correct
27 Correct 2 ms 460 KB Output is correct
28 Correct 68 ms 7164 KB Output is correct
29 Correct 114 ms 10568 KB Output is correct
30 Correct 165 ms 14096 KB Output is correct
31 Correct 193 ms 17468 KB Output is correct
32 Correct 1 ms 204 KB Output is correct
33 Correct 1 ms 204 KB Output is correct
34 Correct 1 ms 204 KB Output is correct
35 Correct 1 ms 204 KB Output is correct
36 Correct 1 ms 204 KB Output is correct
37 Correct 1 ms 204 KB Output is correct
38 Correct 1 ms 204 KB Output is correct
39 Correct 1 ms 204 KB Output is correct
40 Correct 1 ms 204 KB Output is correct
41 Correct 1 ms 204 KB Output is correct
42 Correct 1 ms 204 KB Output is correct
43 Correct 1 ms 332 KB Output is correct
44 Correct 3 ms 332 KB Output is correct
45 Correct 111 ms 8844 KB Output is correct
46 Correct 123 ms 12740 KB Output is correct
47 Correct 123 ms 12740 KB Output is correct
48 Correct 1 ms 204 KB Output is correct
49 Correct 1 ms 204 KB Output is correct
50 Correct 1 ms 204 KB Output is correct
51 Correct 1 ms 204 KB Output is correct
52 Correct 1 ms 204 KB Output is correct
53 Correct 1 ms 204 KB Output is correct
54 Correct 1 ms 256 KB Output is correct
55 Correct 169 ms 17476 KB Output is correct
56 Correct 1 ms 204 KB Output is correct
57 Correct 2 ms 460 KB Output is correct
58 Correct 5 ms 844 KB Output is correct
59 Correct 5 ms 716 KB Output is correct
60 Correct 78 ms 8832 KB Output is correct
61 Correct 111 ms 11844 KB Output is correct
62 Correct 133 ms 14516 KB Output is correct
63 Correct 201 ms 17472 KB Output is correct
64 Correct 1 ms 204 KB Output is correct
65 Correct 1 ms 204 KB Output is correct
66 Correct 2 ms 204 KB Output is correct
67 Correct 179 ms 17472 KB Output is correct
68 Correct 210 ms 17472 KB Output is correct
69 Correct 197 ms 17392 KB Output is correct
70 Correct 6 ms 460 KB Output is correct
71 Correct 4 ms 628 KB Output is correct
72 Correct 92 ms 8816 KB Output is correct
73 Correct 139 ms 13208 KB Output is correct
74 Correct 168 ms 17480 KB Output is correct
75 Correct 163 ms 17472 KB Output is correct
76 Correct 220 ms 17468 KB Output is correct
77 Correct 3 ms 460 KB Output is correct
78 Correct 5 ms 716 KB Output is correct
79 Correct 101 ms 8884 KB Output is correct
80 Correct 142 ms 13204 KB Output is correct
81 Correct 167 ms 17476 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 256 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 80 ms 8884 KB Output is correct
10 Correct 7 ms 1228 KB Output is correct
11 Correct 38 ms 4948 KB Output is correct
12 Correct 10 ms 1692 KB Output is correct
13 Correct 14 ms 2692 KB Output is correct
14 Correct 1 ms 332 KB Output is correct
15 Correct 1 ms 332 KB Output is correct
16 Correct 88 ms 8820 KB Output is correct
17 Correct 1 ms 204 KB Output is correct
18 Correct 1 ms 204 KB Output is correct
19 Correct 1 ms 204 KB Output is correct
20 Correct 164 ms 17480 KB Output is correct
21 Correct 164 ms 17468 KB Output is correct
22 Correct 176 ms 17476 KB Output is correct
23 Correct 142 ms 14916 KB Output is correct
24 Correct 90 ms 8136 KB Output is correct
25 Correct 95 ms 11196 KB Output is correct
26 Correct 97 ms 11196 KB Output is correct
27 Correct 172 ms 17492 KB Output is correct
28 Correct 189 ms 17480 KB Output is correct
29 Correct 176 ms 17600 KB Output is correct
30 Correct 172 ms 17472 KB Output is correct
31 Correct 1 ms 204 KB Output is correct
32 Correct 13 ms 1572 KB Output is correct
33 Correct 39 ms 4228 KB Output is correct
34 Correct 169 ms 17480 KB Output is correct
35 Correct 6 ms 716 KB Output is correct
36 Correct 28 ms 3028 KB Output is correct
37 Correct 55 ms 5740 KB Output is correct
38 Correct 73 ms 7172 KB Output is correct
39 Correct 99 ms 9736 KB Output is correct
40 Correct 129 ms 12356 KB Output is correct
41 Correct 152 ms 14940 KB Output is correct
42 Correct 226 ms 17472 KB Output is correct
43 Correct 1 ms 204 KB Output is correct
44 Correct 1 ms 204 KB Output is correct
45 Correct 1 ms 204 KB Output is correct
46 Correct 1 ms 204 KB Output is correct
47 Correct 1 ms 232 KB Output is correct
48 Correct 1 ms 204 KB Output is correct
49 Correct 1 ms 204 KB Output is correct
50 Correct 1 ms 204 KB Output is correct
51 Correct 1 ms 332 KB Output is correct
52 Correct 1 ms 204 KB Output is correct
53 Correct 1 ms 204 KB Output is correct
54 Correct 1 ms 332 KB Output is correct
55 Correct 3 ms 332 KB Output is correct
56 Correct 88 ms 8912 KB Output is correct
57 Correct 126 ms 12740 KB Output is correct
58 Correct 137 ms 12752 KB Output is correct
59 Correct 1 ms 204 KB Output is correct
60 Correct 1 ms 204 KB Output is correct
61 Correct 1 ms 204 KB Output is correct
62 Correct 183 ms 17464 KB Output is correct
63 Correct 180 ms 17544 KB Output is correct
64 Correct 220 ms 17348 KB Output is correct
65 Correct 3 ms 444 KB Output is correct
66 Correct 5 ms 716 KB Output is correct
67 Correct 80 ms 8900 KB Output is correct
68 Correct 124 ms 13116 KB Output is correct
69 Correct 164 ms 17472 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 256 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 80 ms 8884 KB Output is correct
10 Correct 7 ms 1228 KB Output is correct
11 Correct 38 ms 4948 KB Output is correct
12 Correct 10 ms 1692 KB Output is correct
13 Correct 14 ms 2692 KB Output is correct
14 Correct 1 ms 332 KB Output is correct
15 Correct 1 ms 332 KB Output is correct
16 Correct 88 ms 8820 KB Output is correct
17 Correct 179 ms 17476 KB Output is correct
18 Correct 178 ms 17476 KB Output is correct
19 Correct 163 ms 17476 KB Output is correct
20 Correct 169 ms 17184 KB Output is correct
21 Correct 151 ms 15428 KB Output is correct
22 Correct 1 ms 204 KB Output is correct
23 Correct 29 ms 3292 KB Output is correct
24 Correct 12 ms 1344 KB Output is correct
25 Correct 38 ms 4144 KB Output is correct
26 Correct 67 ms 6872 KB Output is correct
27 Correct 94 ms 8900 KB Output is correct
28 Correct 115 ms 11008 KB Output is correct
29 Correct 137 ms 13124 KB Output is correct
30 Correct 155 ms 15300 KB Output is correct
31 Correct 187 ms 17508 KB Output is correct
32 Correct 166 ms 17480 KB Output is correct
33 Correct 179 ms 17476 KB Output is correct
34 Correct 3 ms 460 KB Output is correct
35 Correct 4 ms 716 KB Output is correct
36 Correct 80 ms 8888 KB Output is correct
37 Correct 124 ms 13176 KB Output is correct
38 Correct 165 ms 17480 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 256 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 80 ms 8884 KB Output is correct
10 Correct 7 ms 1228 KB Output is correct
11 Correct 38 ms 4948 KB Output is correct
12 Correct 10 ms 1692 KB Output is correct
13 Correct 14 ms 2692 KB Output is correct
14 Correct 1 ms 332 KB Output is correct
15 Correct 1 ms 332 KB Output is correct
16 Correct 88 ms 8820 KB Output is correct
17 Correct 1 ms 204 KB Output is correct
18 Correct 1 ms 204 KB Output is correct
19 Correct 1 ms 204 KB Output is correct
20 Correct 1 ms 204 KB Output is correct
21 Correct 1 ms 204 KB Output is correct
22 Correct 1 ms 204 KB Output is correct
23 Correct 181 ms 17476 KB Output is correct
24 Correct 1 ms 204 KB Output is correct
25 Correct 2 ms 332 KB Output is correct
26 Correct 2 ms 332 KB Output is correct
27 Correct 2 ms 460 KB Output is correct
28 Correct 68 ms 7164 KB Output is correct
29 Correct 114 ms 10568 KB Output is correct
30 Correct 165 ms 14096 KB Output is correct
31 Correct 193 ms 17468 KB Output is correct
32 Correct 1 ms 204 KB Output is correct
33 Correct 1 ms 204 KB Output is correct
34 Correct 1 ms 204 KB Output is correct
35 Correct 1 ms 204 KB Output is correct
36 Correct 1 ms 204 KB Output is correct
37 Correct 1 ms 204 KB Output is correct
38 Correct 1 ms 204 KB Output is correct
39 Correct 1 ms 204 KB Output is correct
40 Correct 1 ms 204 KB Output is correct
41 Correct 1 ms 204 KB Output is correct
42 Correct 1 ms 204 KB Output is correct
43 Correct 1 ms 332 KB Output is correct
44 Correct 3 ms 332 KB Output is correct
45 Correct 111 ms 8844 KB Output is correct
46 Correct 123 ms 12740 KB Output is correct
47 Correct 123 ms 12740 KB Output is correct
48 Correct 1 ms 204 KB Output is correct
49 Correct 1 ms 204 KB Output is correct
50 Correct 1 ms 204 KB Output is correct
51 Correct 1 ms 204 KB Output is correct
52 Correct 1 ms 204 KB Output is correct
53 Correct 1 ms 204 KB Output is correct
54 Correct 1 ms 256 KB Output is correct
55 Correct 169 ms 17476 KB Output is correct
56 Correct 1 ms 204 KB Output is correct
57 Correct 2 ms 460 KB Output is correct
58 Correct 5 ms 844 KB Output is correct
59 Correct 5 ms 716 KB Output is correct
60 Correct 78 ms 8832 KB Output is correct
61 Correct 111 ms 11844 KB Output is correct
62 Correct 133 ms 14516 KB Output is correct
63 Correct 201 ms 17472 KB Output is correct
64 Correct 1 ms 204 KB Output is correct
65 Correct 1 ms 204 KB Output is correct
66 Correct 2 ms 204 KB Output is correct
67 Correct 179 ms 17472 KB Output is correct
68 Correct 210 ms 17472 KB Output is correct
69 Correct 197 ms 17392 KB Output is correct
70 Correct 6 ms 460 KB Output is correct
71 Correct 4 ms 628 KB Output is correct
72 Correct 92 ms 8816 KB Output is correct
73 Correct 139 ms 13208 KB Output is correct
74 Correct 168 ms 17480 KB Output is correct
75 Correct 163 ms 17472 KB Output is correct
76 Correct 220 ms 17468 KB Output is correct
77 Correct 3 ms 460 KB Output is correct
78 Correct 5 ms 716 KB Output is correct
79 Correct 101 ms 8884 KB Output is correct
80 Correct 142 ms 13204 KB Output is correct
81 Correct 167 ms 17476 KB Output is correct
82 Correct 1 ms 204 KB Output is correct
83 Correct 1 ms 204 KB Output is correct
84 Correct 1 ms 204 KB Output is correct
85 Correct 164 ms 17480 KB Output is correct
86 Correct 164 ms 17468 KB Output is correct
87 Correct 176 ms 17476 KB Output is correct
88 Correct 142 ms 14916 KB Output is correct
89 Correct 90 ms 8136 KB Output is correct
90 Correct 95 ms 11196 KB Output is correct
91 Correct 97 ms 11196 KB Output is correct
92 Correct 172 ms 17492 KB Output is correct
93 Correct 189 ms 17480 KB Output is correct
94 Correct 176 ms 17600 KB Output is correct
95 Correct 172 ms 17472 KB Output is correct
96 Correct 1 ms 204 KB Output is correct
97 Correct 13 ms 1572 KB Output is correct
98 Correct 39 ms 4228 KB Output is correct
99 Correct 169 ms 17480 KB Output is correct
100 Correct 6 ms 716 KB Output is correct
101 Correct 28 ms 3028 KB Output is correct
102 Correct 55 ms 5740 KB Output is correct
103 Correct 73 ms 7172 KB Output is correct
104 Correct 99 ms 9736 KB Output is correct
105 Correct 129 ms 12356 KB Output is correct
106 Correct 152 ms 14940 KB Output is correct
107 Correct 226 ms 17472 KB Output is correct
108 Correct 1 ms 204 KB Output is correct
109 Correct 1 ms 204 KB Output is correct
110 Correct 1 ms 204 KB Output is correct
111 Correct 1 ms 204 KB Output is correct
112 Correct 1 ms 232 KB Output is correct
113 Correct 1 ms 204 KB Output is correct
114 Correct 1 ms 204 KB Output is correct
115 Correct 1 ms 204 KB Output is correct
116 Correct 1 ms 332 KB Output is correct
117 Correct 1 ms 204 KB Output is correct
118 Correct 1 ms 204 KB Output is correct
119 Correct 1 ms 332 KB Output is correct
120 Correct 3 ms 332 KB Output is correct
121 Correct 88 ms 8912 KB Output is correct
122 Correct 126 ms 12740 KB Output is correct
123 Correct 137 ms 12752 KB Output is correct
124 Correct 1 ms 204 KB Output is correct
125 Correct 1 ms 204 KB Output is correct
126 Correct 1 ms 204 KB Output is correct
127 Correct 183 ms 17464 KB Output is correct
128 Correct 180 ms 17544 KB Output is correct
129 Correct 220 ms 17348 KB Output is correct
130 Correct 3 ms 444 KB Output is correct
131 Correct 5 ms 716 KB Output is correct
132 Correct 80 ms 8900 KB Output is correct
133 Correct 124 ms 13116 KB Output is correct
134 Correct 164 ms 17472 KB Output is correct
135 Correct 179 ms 17476 KB Output is correct
136 Correct 178 ms 17476 KB Output is correct
137 Correct 163 ms 17476 KB Output is correct
138 Correct 169 ms 17184 KB Output is correct
139 Correct 151 ms 15428 KB Output is correct
140 Correct 1 ms 204 KB Output is correct
141 Correct 29 ms 3292 KB Output is correct
142 Correct 12 ms 1344 KB Output is correct
143 Correct 38 ms 4144 KB Output is correct
144 Correct 67 ms 6872 KB Output is correct
145 Correct 94 ms 8900 KB Output is correct
146 Correct 115 ms 11008 KB Output is correct
147 Correct 137 ms 13124 KB Output is correct
148 Correct 155 ms 15300 KB Output is correct
149 Correct 187 ms 17508 KB Output is correct
150 Correct 166 ms 17480 KB Output is correct
151 Correct 179 ms 17476 KB Output is correct
152 Correct 3 ms 460 KB Output is correct
153 Correct 4 ms 716 KB Output is correct
154 Correct 80 ms 8888 KB Output is correct
155 Correct 124 ms 13176 KB Output is correct
156 Correct 165 ms 17480 KB Output is correct
157 Correct 1 ms 204 KB Output is correct
158 Correct 1 ms 204 KB Output is correct
159 Correct 1 ms 204 KB Output is correct
160 Correct 1 ms 204 KB Output is correct
161 Correct 169 ms 17476 KB Output is correct
162 Correct 193 ms 17472 KB Output is correct
163 Correct 214 ms 17468 KB Output is correct
164 Correct 170 ms 17468 KB Output is correct
165 Correct 165 ms 17472 KB Output is correct
166 Correct 176 ms 17480 KB Output is correct
167 Correct 40 ms 4300 KB Output is correct
168 Correct 15 ms 1856 KB Output is correct
169 Correct 41 ms 4676 KB Output is correct
170 Correct 80 ms 8512 KB Output is correct
171 Correct 105 ms 11200 KB Output is correct
172 Correct 89 ms 8900 KB Output is correct
173 Correct 104 ms 10576 KB Output is correct
174 Correct 126 ms 12228 KB Output is correct
175 Correct 137 ms 14092 KB Output is correct
176 Correct 165 ms 15900 KB Output is correct
177 Correct 175 ms 17476 KB Output is correct