Submission #445398

# Submission time Handle Problem Language Result Execution time Memory
445398 2021-07-17T21:25:59 Z apostoldaniel854 Fountain Parks (IOI21_parks) C++17
100 / 100
686 ms 56712 KB
#include "parks.h"

#include <map>
#include <algorithm>
#include <iostream>
const int MAX_N = 2e5;

int dx[] = {0, 0, -1, 1};
int dy[] = {-1, 1, 0, 0};
int dxb[] = {-1, -1, 1, 1};
int dyb[] = {-1, 1, -1, 1};
bool used[1 + MAX_N];
std::map <std::pair <int, int>, int> fountains;
int nr;
void dfs (int node, std::vector <int> &x, std::vector <int> &y) {
    used[node] = true;
    ++nr;
    for (int dir = 0; dir < 4; dir++) {
        int nx = x[node] + 2 * dx[dir];
        int ny = y[node] + 2 * dy[dir];
        if (fountains.count ({nx, ny})) {
            int vec = fountains[{nx, ny}];
            if (not used[vec])
                dfs (vec, x, y);
        }

    }
}

int construct_roads(std::vector<int> x, std::vector<int> y) {
    std::vector<int> u, v, a, b;
    int n = x.size ();
    std::vector <std::pair <int, int>> bitches;
    for (int i = 0; i < n; i++) {
        fountains[{x[i], y[i]}] = i;
        for (int dir = 0; dir < 4; dir++) {
            int nx = x[i] + dxb[dir];
            int ny = y[i] + dyb[dir];
            bitches.push_back ({nx, ny});
        }
    }
    nr = 0;
    dfs (0, x, y);
    if (nr < n)
        return 0;
    sort (bitches.begin (), bitches.end ());
    bitches.resize (std::unique (bitches.begin (), bitches.end ()) - bitches.begin ());
    for (std::pair <int, int> p : bitches) {
        int color = (p.first / 2 + p.second / 2) % 2;
        if (color == 0) {
            /// <- or -> orizontal road

            /// case 1 try from above
            if (fountains.count({p.first - 1, p.second - 1}) && fountains.count ({p.first - 1, p.second + 1})) {
                u.push_back (fountains[{p.first - 1, p.second - 1}]);
                v.push_back (fountains[{p.first - 1, p.second + 1}]);
                a.push_back (p.first);
                b.push_back (p.second);
            }
            /// case 2 try from below
            else if (fountains.count ({p.first + 1, p.second - 1}) && fountains.count ({p.first + 1, p.second + 1})) {
                u.push_back (fountains[{p.first + 1, p.second - 1}]);
                v.push_back (fountains[{p.first + 1, p.second + 1}]);
                a.push_back (p.first);
                b.push_back (p.second);
            }
        }
        else {
            /// v or ^ vertical road

            /// case 1 try from the LHS
            if (fountains.count({p.first - 1, p.second - 1}) && fountains.count ({p.first + 1, p.second - 1})) {
                u.push_back (fountains[{p.first - 1, p.second - 1}]);
                v.push_back (fountains[{p.first + 1, p.second - 1}]);
                a.push_back (p.first);
                b.push_back (p.second);
            }
            /// case 2 try from the RHS
            else if (fountains.count ({p.first - 1, p.second + 1}) && fountains.count ({p.first + 1, p.second + 1})) {
                u.push_back (fountains[{p.first - 1, p.second + 1}]);
                v.push_back (fountains[{p.first + 1, p.second + 1}]);
                a.push_back (p.first);
                b.push_back (p.second);
            }
        }
    }
    build(u, v, a, b);
    return 1;
}
/**
5
4 4
4 6
6 4
4 2
2 4

**/
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 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 0 ms 300 KB Output is correct
6 Correct 0 ms 204 KB Output is correct
7 Correct 0 ms 204 KB Output is correct
8 Correct 0 ms 204 KB Output is correct
9 Correct 242 ms 27280 KB Output is correct
10 Correct 21 ms 3072 KB Output is correct
11 Correct 129 ms 15224 KB Output is correct
12 Correct 33 ms 4392 KB Output is correct
13 Correct 39 ms 8732 KB Output is correct
14 Correct 1 ms 332 KB Output is correct
15 Correct 2 ms 460 KB Output is correct
16 Correct 243 ms 22876 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 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 0 ms 300 KB Output is correct
6 Correct 0 ms 204 KB Output is correct
7 Correct 0 ms 204 KB Output is correct
8 Correct 0 ms 204 KB Output is correct
9 Correct 242 ms 27280 KB Output is correct
10 Correct 21 ms 3072 KB Output is correct
11 Correct 129 ms 15224 KB Output is correct
12 Correct 33 ms 4392 KB Output is correct
13 Correct 39 ms 8732 KB Output is correct
14 Correct 1 ms 332 KB Output is correct
15 Correct 2 ms 460 KB Output is correct
16 Correct 243 ms 22876 KB Output is correct
17 Correct 1 ms 204 KB Output is correct
18 Correct 0 ms 296 KB Output is correct
19 Correct 0 ms 204 KB Output is correct
20 Correct 0 ms 204 KB Output is correct
21 Correct 1 ms 300 KB Output is correct
22 Correct 1 ms 204 KB Output is correct
23 Correct 594 ms 56120 KB Output is correct
24 Correct 0 ms 204 KB Output is correct
25 Correct 3 ms 588 KB Output is correct
26 Correct 2 ms 716 KB Output is correct
27 Correct 3 ms 844 KB Output is correct
28 Correct 203 ms 22772 KB Output is correct
29 Correct 316 ms 33404 KB Output is correct
30 Correct 448 ms 45532 KB Output is correct
31 Correct 573 ms 56028 KB Output is correct
32 Correct 0 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 0 ms 304 KB Output is correct
37 Correct 1 ms 204 KB Output is correct
38 Correct 0 ms 204 KB Output is correct
39 Correct 0 ms 204 KB Output is correct
40 Correct 0 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 2 ms 568 KB Output is correct
44 Correct 2 ms 588 KB Output is correct
45 Correct 274 ms 23988 KB Output is correct
46 Correct 407 ms 36132 KB Output is correct
47 Correct 403 ms 35488 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 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 0 ms 300 KB Output is correct
6 Correct 0 ms 204 KB Output is correct
7 Correct 0 ms 204 KB Output is correct
8 Correct 0 ms 204 KB Output is correct
9 Correct 242 ms 27280 KB Output is correct
10 Correct 21 ms 3072 KB Output is correct
11 Correct 129 ms 15224 KB Output is correct
12 Correct 33 ms 4392 KB Output is correct
13 Correct 39 ms 8732 KB Output is correct
14 Correct 1 ms 332 KB Output is correct
15 Correct 2 ms 460 KB Output is correct
16 Correct 243 ms 22876 KB Output is correct
17 Correct 1 ms 204 KB Output is correct
18 Correct 0 ms 296 KB Output is correct
19 Correct 0 ms 204 KB Output is correct
20 Correct 0 ms 204 KB Output is correct
21 Correct 1 ms 300 KB Output is correct
22 Correct 1 ms 204 KB Output is correct
23 Correct 594 ms 56120 KB Output is correct
24 Correct 0 ms 204 KB Output is correct
25 Correct 3 ms 588 KB Output is correct
26 Correct 2 ms 716 KB Output is correct
27 Correct 3 ms 844 KB Output is correct
28 Correct 203 ms 22772 KB Output is correct
29 Correct 316 ms 33404 KB Output is correct
30 Correct 448 ms 45532 KB Output is correct
31 Correct 573 ms 56028 KB Output is correct
32 Correct 0 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 0 ms 304 KB Output is correct
37 Correct 1 ms 204 KB Output is correct
38 Correct 0 ms 204 KB Output is correct
39 Correct 0 ms 204 KB Output is correct
40 Correct 0 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 2 ms 568 KB Output is correct
44 Correct 2 ms 588 KB Output is correct
45 Correct 274 ms 23988 KB Output is correct
46 Correct 407 ms 36132 KB Output is correct
47 Correct 403 ms 35488 KB Output is correct
48 Correct 1 ms 204 KB Output is correct
49 Correct 0 ms 204 KB Output is correct
50 Correct 0 ms 204 KB Output is correct
51 Correct 0 ms 204 KB Output is correct
52 Correct 0 ms 300 KB Output is correct
53 Correct 1 ms 204 KB Output is correct
54 Correct 1 ms 204 KB Output is correct
55 Correct 590 ms 53872 KB Output is correct
56 Correct 1 ms 204 KB Output is correct
57 Correct 5 ms 716 KB Output is correct
58 Correct 14 ms 1912 KB Output is correct
59 Correct 8 ms 1588 KB Output is correct
60 Correct 256 ms 24632 KB Output is correct
61 Correct 373 ms 38328 KB Output is correct
62 Correct 471 ms 45480 KB Output is correct
63 Correct 586 ms 53788 KB Output is correct
64 Correct 1 ms 204 KB Output is correct
65 Correct 0 ms 204 KB Output is correct
66 Correct 0 ms 204 KB Output is correct
67 Correct 545 ms 49748 KB Output is correct
68 Correct 573 ms 50048 KB Output is correct
69 Correct 547 ms 52268 KB Output is correct
70 Correct 3 ms 844 KB Output is correct
71 Correct 7 ms 1328 KB Output is correct
72 Correct 274 ms 20748 KB Output is correct
73 Correct 429 ms 34720 KB Output is correct
74 Correct 603 ms 41656 KB Output is correct
75 Correct 583 ms 53024 KB Output is correct
76 Correct 552 ms 56120 KB Output is correct
77 Correct 4 ms 968 KB Output is correct
78 Correct 6 ms 1480 KB Output is correct
79 Correct 265 ms 21932 KB Output is correct
80 Correct 449 ms 34104 KB Output is correct
81 Correct 612 ms 44576 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 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 0 ms 300 KB Output is correct
6 Correct 0 ms 204 KB Output is correct
7 Correct 0 ms 204 KB Output is correct
8 Correct 0 ms 204 KB Output is correct
9 Correct 242 ms 27280 KB Output is correct
10 Correct 21 ms 3072 KB Output is correct
11 Correct 129 ms 15224 KB Output is correct
12 Correct 33 ms 4392 KB Output is correct
13 Correct 39 ms 8732 KB Output is correct
14 Correct 1 ms 332 KB Output is correct
15 Correct 2 ms 460 KB Output is correct
16 Correct 243 ms 22876 KB Output is correct
17 Correct 0 ms 204 KB Output is correct
18 Correct 1 ms 204 KB Output is correct
19 Correct 0 ms 204 KB Output is correct
20 Correct 603 ms 56384 KB Output is correct
21 Correct 618 ms 51948 KB Output is correct
22 Correct 623 ms 49572 KB Output is correct
23 Correct 492 ms 41704 KB Output is correct
24 Correct 196 ms 23824 KB Output is correct
25 Correct 193 ms 24056 KB Output is correct
26 Correct 171 ms 23964 KB Output is correct
27 Correct 525 ms 34332 KB Output is correct
28 Correct 512 ms 34208 KB Output is correct
29 Correct 658 ms 34292 KB Output is correct
30 Correct 686 ms 34220 KB Output is correct
31 Correct 1 ms 204 KB Output is correct
32 Correct 34 ms 3336 KB Output is correct
33 Correct 68 ms 12436 KB Output is correct
34 Correct 583 ms 52832 KB Output is correct
35 Correct 8 ms 1608 KB Output is correct
36 Correct 40 ms 6392 KB Output is correct
37 Correct 78 ms 12556 KB Output is correct
38 Correct 217 ms 14568 KB Output is correct
39 Correct 308 ms 19244 KB Output is correct
40 Correct 419 ms 25572 KB Output is correct
41 Correct 498 ms 30424 KB Output is correct
42 Correct 597 ms 35228 KB Output is correct
43 Correct 0 ms 204 KB Output is correct
44 Correct 0 ms 204 KB Output is correct
45 Correct 0 ms 204 KB Output is correct
46 Correct 0 ms 204 KB Output is correct
47 Correct 1 ms 296 KB Output is correct
48 Correct 0 ms 204 KB Output is correct
49 Correct 0 ms 204 KB Output is correct
50 Correct 1 ms 204 KB Output is correct
51 Correct 0 ms 204 KB Output is correct
52 Correct 0 ms 204 KB Output is correct
53 Correct 0 ms 204 KB Output is correct
54 Correct 2 ms 588 KB Output is correct
55 Correct 2 ms 620 KB Output is correct
56 Correct 260 ms 23984 KB Output is correct
57 Correct 407 ms 36128 KB Output is correct
58 Correct 420 ms 35488 KB Output is correct
59 Correct 0 ms 204 KB Output is correct
60 Correct 0 ms 204 KB Output is correct
61 Correct 1 ms 204 KB Output is correct
62 Correct 558 ms 49956 KB Output is correct
63 Correct 564 ms 50116 KB Output is correct
64 Correct 534 ms 52256 KB Output is correct
65 Correct 3 ms 844 KB Output is correct
66 Correct 5 ms 1352 KB Output is correct
67 Correct 271 ms 20796 KB Output is correct
68 Correct 439 ms 34724 KB Output is correct
69 Correct 593 ms 41696 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 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 0 ms 300 KB Output is correct
6 Correct 0 ms 204 KB Output is correct
7 Correct 0 ms 204 KB Output is correct
8 Correct 0 ms 204 KB Output is correct
9 Correct 242 ms 27280 KB Output is correct
10 Correct 21 ms 3072 KB Output is correct
11 Correct 129 ms 15224 KB Output is correct
12 Correct 33 ms 4392 KB Output is correct
13 Correct 39 ms 8732 KB Output is correct
14 Correct 1 ms 332 KB Output is correct
15 Correct 2 ms 460 KB Output is correct
16 Correct 243 ms 22876 KB Output is correct
17 Correct 590 ms 56520 KB Output is correct
18 Correct 567 ms 54556 KB Output is correct
19 Correct 629 ms 56712 KB Output is correct
20 Correct 588 ms 46464 KB Output is correct
21 Correct 527 ms 38944 KB Output is correct
22 Correct 1 ms 204 KB Output is correct
23 Correct 84 ms 6652 KB Output is correct
24 Correct 18 ms 3264 KB Output is correct
25 Correct 62 ms 10424 KB Output is correct
26 Correct 98 ms 15532 KB Output is correct
27 Correct 282 ms 22936 KB Output is correct
28 Correct 373 ms 30172 KB Output is correct
29 Correct 454 ms 34696 KB Output is correct
30 Correct 550 ms 40708 KB Output is correct
31 Correct 618 ms 45208 KB Output is correct
32 Correct 586 ms 53024 KB Output is correct
33 Correct 552 ms 56120 KB Output is correct
34 Correct 4 ms 968 KB Output is correct
35 Correct 7 ms 1560 KB Output is correct
36 Correct 276 ms 21932 KB Output is correct
37 Correct 420 ms 34072 KB Output is correct
38 Correct 581 ms 44448 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 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 0 ms 300 KB Output is correct
6 Correct 0 ms 204 KB Output is correct
7 Correct 0 ms 204 KB Output is correct
8 Correct 0 ms 204 KB Output is correct
9 Correct 242 ms 27280 KB Output is correct
10 Correct 21 ms 3072 KB Output is correct
11 Correct 129 ms 15224 KB Output is correct
12 Correct 33 ms 4392 KB Output is correct
13 Correct 39 ms 8732 KB Output is correct
14 Correct 1 ms 332 KB Output is correct
15 Correct 2 ms 460 KB Output is correct
16 Correct 243 ms 22876 KB Output is correct
17 Correct 1 ms 204 KB Output is correct
18 Correct 0 ms 296 KB Output is correct
19 Correct 0 ms 204 KB Output is correct
20 Correct 0 ms 204 KB Output is correct
21 Correct 1 ms 300 KB Output is correct
22 Correct 1 ms 204 KB Output is correct
23 Correct 594 ms 56120 KB Output is correct
24 Correct 0 ms 204 KB Output is correct
25 Correct 3 ms 588 KB Output is correct
26 Correct 2 ms 716 KB Output is correct
27 Correct 3 ms 844 KB Output is correct
28 Correct 203 ms 22772 KB Output is correct
29 Correct 316 ms 33404 KB Output is correct
30 Correct 448 ms 45532 KB Output is correct
31 Correct 573 ms 56028 KB Output is correct
32 Correct 0 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 0 ms 304 KB Output is correct
37 Correct 1 ms 204 KB Output is correct
38 Correct 0 ms 204 KB Output is correct
39 Correct 0 ms 204 KB Output is correct
40 Correct 0 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 2 ms 568 KB Output is correct
44 Correct 2 ms 588 KB Output is correct
45 Correct 274 ms 23988 KB Output is correct
46 Correct 407 ms 36132 KB Output is correct
47 Correct 403 ms 35488 KB Output is correct
48 Correct 1 ms 204 KB Output is correct
49 Correct 0 ms 204 KB Output is correct
50 Correct 0 ms 204 KB Output is correct
51 Correct 0 ms 204 KB Output is correct
52 Correct 0 ms 300 KB Output is correct
53 Correct 1 ms 204 KB Output is correct
54 Correct 1 ms 204 KB Output is correct
55 Correct 590 ms 53872 KB Output is correct
56 Correct 1 ms 204 KB Output is correct
57 Correct 5 ms 716 KB Output is correct
58 Correct 14 ms 1912 KB Output is correct
59 Correct 8 ms 1588 KB Output is correct
60 Correct 256 ms 24632 KB Output is correct
61 Correct 373 ms 38328 KB Output is correct
62 Correct 471 ms 45480 KB Output is correct
63 Correct 586 ms 53788 KB Output is correct
64 Correct 1 ms 204 KB Output is correct
65 Correct 0 ms 204 KB Output is correct
66 Correct 0 ms 204 KB Output is correct
67 Correct 545 ms 49748 KB Output is correct
68 Correct 573 ms 50048 KB Output is correct
69 Correct 547 ms 52268 KB Output is correct
70 Correct 3 ms 844 KB Output is correct
71 Correct 7 ms 1328 KB Output is correct
72 Correct 274 ms 20748 KB Output is correct
73 Correct 429 ms 34720 KB Output is correct
74 Correct 603 ms 41656 KB Output is correct
75 Correct 583 ms 53024 KB Output is correct
76 Correct 552 ms 56120 KB Output is correct
77 Correct 4 ms 968 KB Output is correct
78 Correct 6 ms 1480 KB Output is correct
79 Correct 265 ms 21932 KB Output is correct
80 Correct 449 ms 34104 KB Output is correct
81 Correct 612 ms 44576 KB Output is correct
82 Correct 0 ms 204 KB Output is correct
83 Correct 1 ms 204 KB Output is correct
84 Correct 0 ms 204 KB Output is correct
85 Correct 603 ms 56384 KB Output is correct
86 Correct 618 ms 51948 KB Output is correct
87 Correct 623 ms 49572 KB Output is correct
88 Correct 492 ms 41704 KB Output is correct
89 Correct 196 ms 23824 KB Output is correct
90 Correct 193 ms 24056 KB Output is correct
91 Correct 171 ms 23964 KB Output is correct
92 Correct 525 ms 34332 KB Output is correct
93 Correct 512 ms 34208 KB Output is correct
94 Correct 658 ms 34292 KB Output is correct
95 Correct 686 ms 34220 KB Output is correct
96 Correct 1 ms 204 KB Output is correct
97 Correct 34 ms 3336 KB Output is correct
98 Correct 68 ms 12436 KB Output is correct
99 Correct 583 ms 52832 KB Output is correct
100 Correct 8 ms 1608 KB Output is correct
101 Correct 40 ms 6392 KB Output is correct
102 Correct 78 ms 12556 KB Output is correct
103 Correct 217 ms 14568 KB Output is correct
104 Correct 308 ms 19244 KB Output is correct
105 Correct 419 ms 25572 KB Output is correct
106 Correct 498 ms 30424 KB Output is correct
107 Correct 597 ms 35228 KB Output is correct
108 Correct 0 ms 204 KB Output is correct
109 Correct 0 ms 204 KB Output is correct
110 Correct 0 ms 204 KB Output is correct
111 Correct 0 ms 204 KB Output is correct
112 Correct 1 ms 296 KB Output is correct
113 Correct 0 ms 204 KB Output is correct
114 Correct 0 ms 204 KB Output is correct
115 Correct 1 ms 204 KB Output is correct
116 Correct 0 ms 204 KB Output is correct
117 Correct 0 ms 204 KB Output is correct
118 Correct 0 ms 204 KB Output is correct
119 Correct 2 ms 588 KB Output is correct
120 Correct 2 ms 620 KB Output is correct
121 Correct 260 ms 23984 KB Output is correct
122 Correct 407 ms 36128 KB Output is correct
123 Correct 420 ms 35488 KB Output is correct
124 Correct 0 ms 204 KB Output is correct
125 Correct 0 ms 204 KB Output is correct
126 Correct 1 ms 204 KB Output is correct
127 Correct 558 ms 49956 KB Output is correct
128 Correct 564 ms 50116 KB Output is correct
129 Correct 534 ms 52256 KB Output is correct
130 Correct 3 ms 844 KB Output is correct
131 Correct 5 ms 1352 KB Output is correct
132 Correct 271 ms 20796 KB Output is correct
133 Correct 439 ms 34724 KB Output is correct
134 Correct 593 ms 41696 KB Output is correct
135 Correct 590 ms 56520 KB Output is correct
136 Correct 567 ms 54556 KB Output is correct
137 Correct 629 ms 56712 KB Output is correct
138 Correct 588 ms 46464 KB Output is correct
139 Correct 527 ms 38944 KB Output is correct
140 Correct 1 ms 204 KB Output is correct
141 Correct 84 ms 6652 KB Output is correct
142 Correct 18 ms 3264 KB Output is correct
143 Correct 62 ms 10424 KB Output is correct
144 Correct 98 ms 15532 KB Output is correct
145 Correct 282 ms 22936 KB Output is correct
146 Correct 373 ms 30172 KB Output is correct
147 Correct 454 ms 34696 KB Output is correct
148 Correct 550 ms 40708 KB Output is correct
149 Correct 618 ms 45208 KB Output is correct
150 Correct 586 ms 53024 KB Output is correct
151 Correct 552 ms 56120 KB Output is correct
152 Correct 4 ms 968 KB Output is correct
153 Correct 7 ms 1560 KB Output is correct
154 Correct 276 ms 21932 KB Output is correct
155 Correct 420 ms 34072 KB Output is correct
156 Correct 581 ms 44448 KB Output is correct
157 Correct 0 ms 204 KB Output is correct
158 Correct 0 ms 204 KB Output is correct
159 Correct 0 ms 296 KB Output is correct
160 Correct 1 ms 204 KB Output is correct
161 Correct 587 ms 55984 KB Output is correct
162 Correct 587 ms 49568 KB Output is correct
163 Correct 591 ms 44064 KB Output is correct
164 Correct 592 ms 43220 KB Output is correct
165 Correct 580 ms 53912 KB Output is correct
166 Correct 580 ms 55704 KB Output is correct
167 Correct 114 ms 9524 KB Output is correct
168 Correct 27 ms 4516 KB Output is correct
169 Correct 71 ms 10880 KB Output is correct
170 Correct 132 ms 20912 KB Output is correct
171 Correct 175 ms 25248 KB Output is correct
172 Correct 257 ms 22548 KB Output is correct
173 Correct 329 ms 27256 KB Output is correct
174 Correct 393 ms 30960 KB Output is correct
175 Correct 441 ms 35872 KB Output is correct
176 Correct 523 ms 42180 KB Output is correct
177 Correct 576 ms 45340 KB Output is correct