Submission #1068795

# Submission time Handle Problem Language Result Execution time Memory
1068795 2024-08-21T12:13:21 Z Boas Fountain Parks (IOI21_parks) C++17
70 / 100
3500 ms 67776 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'004;

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;
    assert(sz(u) == n - 1);
    for (int benchesBuilt = 0; benchesBuilt < sz(u); benchesBuilt++)
    {
        ll x = -1, y = -1;
        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;
            }
        }
        while (x < 0 || y < 0)
        {
            x--;
        }
        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 if (roads.count(toInt({x, y - 1})))
        {
            loc = {x, y - 1};
            addNeighbour(x, y - 2, -1);
        }
        else
            throw;
        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 0 ms 348 KB Output is correct
2 Correct 0 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 1 ms 344 KB Output is correct
6 Correct 1 ms 344 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 86 ms 32980 KB Output is correct
10 Correct 7 ms 3676 KB Output is correct
11 Correct 38 ms 18380 KB Output is correct
12 Correct 12 ms 5300 KB Output is correct
13 Correct 17 ms 11372 KB Output is correct
14 Correct 1 ms 344 KB Output is correct
15 Correct 1 ms 604 KB Output is correct
16 Correct 84 ms 27944 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 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 1 ms 344 KB Output is correct
6 Correct 1 ms 344 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 86 ms 32980 KB Output is correct
10 Correct 7 ms 3676 KB Output is correct
11 Correct 38 ms 18380 KB Output is correct
12 Correct 12 ms 5300 KB Output is correct
13 Correct 17 ms 11372 KB Output is correct
14 Correct 1 ms 344 KB Output is correct
15 Correct 1 ms 604 KB Output is correct
16 Correct 84 ms 27944 KB Output is correct
17 Correct 1 ms 348 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 0 ms 344 KB Output is correct
23 Correct 223 ms 57464 KB Output is correct
24 Correct 1 ms 344 KB Output is correct
25 Correct 1 ms 600 KB Output is correct
26 Correct 1 ms 860 KB Output is correct
27 Correct 2 ms 604 KB Output is correct
28 Correct 69 ms 22760 KB Output is correct
29 Correct 116 ms 32196 KB Output is correct
30 Correct 155 ms 44156 KB Output is correct
31 Correct 230 ms 55044 KB Output is correct
32 Correct 0 ms 348 KB Output is correct
33 Correct 0 ms 348 KB Output is correct
34 Correct 0 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 0 ms 348 KB Output is correct
38 Correct 0 ms 344 KB Output is correct
39 Correct 0 ms 344 KB Output is correct
40 Correct 0 ms 348 KB Output is correct
41 Correct 0 ms 348 KB Output is correct
42 Correct 0 ms 348 KB Output is correct
43 Correct 1 ms 776 KB Output is correct
44 Correct 1 ms 604 KB Output is correct
45 Correct 100 ms 25960 KB Output is correct
46 Correct 161 ms 38384 KB Output is correct
47 Correct 173 ms 37504 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 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 1 ms 344 KB Output is correct
6 Correct 1 ms 344 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 86 ms 32980 KB Output is correct
10 Correct 7 ms 3676 KB Output is correct
11 Correct 38 ms 18380 KB Output is correct
12 Correct 12 ms 5300 KB Output is correct
13 Correct 17 ms 11372 KB Output is correct
14 Correct 1 ms 344 KB Output is correct
15 Correct 1 ms 604 KB Output is correct
16 Correct 84 ms 27944 KB Output is correct
17 Correct 1 ms 348 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 0 ms 344 KB Output is correct
23 Correct 223 ms 57464 KB Output is correct
24 Correct 1 ms 344 KB Output is correct
25 Correct 1 ms 600 KB Output is correct
26 Correct 1 ms 860 KB Output is correct
27 Correct 2 ms 604 KB Output is correct
28 Correct 69 ms 22760 KB Output is correct
29 Correct 116 ms 32196 KB Output is correct
30 Correct 155 ms 44156 KB Output is correct
31 Correct 230 ms 55044 KB Output is correct
32 Correct 0 ms 348 KB Output is correct
33 Correct 0 ms 348 KB Output is correct
34 Correct 0 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 0 ms 348 KB Output is correct
38 Correct 0 ms 344 KB Output is correct
39 Correct 0 ms 344 KB Output is correct
40 Correct 0 ms 348 KB Output is correct
41 Correct 0 ms 348 KB Output is correct
42 Correct 0 ms 348 KB Output is correct
43 Correct 1 ms 776 KB Output is correct
44 Correct 1 ms 604 KB Output is correct
45 Correct 100 ms 25960 KB Output is correct
46 Correct 161 ms 38384 KB Output is correct
47 Correct 173 ms 37504 KB Output is correct
48 Correct 1 ms 600 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 348 KB Output is correct
53 Correct 0 ms 348 KB Output is correct
54 Correct 0 ms 344 KB Output is correct
55 Correct 262 ms 52460 KB Output is correct
56 Correct 0 ms 344 KB Output is correct
57 Correct 2 ms 860 KB Output is correct
58 Correct 5 ms 2140 KB Output is correct
59 Correct 3 ms 1624 KB Output is correct
60 Correct 89 ms 29032 KB Output is correct
61 Correct 135 ms 37832 KB Output is correct
62 Correct 190 ms 43076 KB Output is correct
63 Correct 229 ms 51324 KB Output is correct
64 Correct 1 ms 348 KB Output is correct
65 Correct 0 ms 344 KB Output is correct
66 Correct 0 ms 348 KB Output is correct
67 Correct 195 ms 61824 KB Output is correct
68 Correct 216 ms 61004 KB Output is correct
69 Correct 199 ms 63428 KB Output is correct
70 Correct 2 ms 860 KB Output is correct
71 Correct 4 ms 1260 KB Output is correct
72 Correct 116 ms 22456 KB Output is correct
73 Correct 185 ms 35780 KB Output is correct
74 Correct 291 ms 44672 KB Output is correct
75 Correct 378 ms 55680 KB Output is correct
76 Correct 211 ms 67660 KB Output is correct
77 Correct 3 ms 1116 KB Output is correct
78 Correct 4 ms 1628 KB Output is correct
79 Correct 116 ms 24632 KB Output is correct
80 Correct 196 ms 37196 KB Output is correct
81 Correct 374 ms 50144 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 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 1 ms 344 KB Output is correct
6 Correct 1 ms 344 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 86 ms 32980 KB Output is correct
10 Correct 7 ms 3676 KB Output is correct
11 Correct 38 ms 18380 KB Output is correct
12 Correct 12 ms 5300 KB Output is correct
13 Correct 17 ms 11372 KB Output is correct
14 Correct 1 ms 344 KB Output is correct
15 Correct 1 ms 604 KB Output is correct
16 Correct 84 ms 27944 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 0 ms 348 KB Output is correct
20 Correct 228 ms 59068 KB Output is correct
21 Correct 209 ms 54396 KB Output is correct
22 Correct 252 ms 51464 KB Output is correct
23 Correct 232 ms 46108 KB Output is correct
24 Correct 52 ms 13952 KB Output is correct
25 Correct 48 ms 14080 KB Output is correct
26 Correct 54 ms 14204 KB Output is correct
27 Correct 271 ms 44412 KB Output is correct
28 Correct 218 ms 44540 KB Output is correct
29 Correct 219 ms 44156 KB Output is correct
30 Correct 213 ms 44160 KB Output is correct
31 Correct 0 ms 344 KB Output is correct
32 Correct 16 ms 3604 KB Output is correct
33 Correct 24 ms 7228 KB Output is correct
34 Correct 242 ms 55308 KB Output is correct
35 Correct 5 ms 1368 KB Output is correct
36 Correct 18 ms 4968 KB Output is correct
37 Correct 34 ms 8400 KB Output is correct
38 Correct 103 ms 13360 KB Output is correct
39 Correct 124 ms 19656 KB Output is correct
40 Correct 164 ms 24004 KB Output is correct
41 Correct 214 ms 27332 KB Output is correct
42 Correct 241 ms 34172 KB Output is correct
43 Correct 0 ms 348 KB Output is correct
44 Correct 0 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 0 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 0 ms 344 KB Output is correct
51 Correct 0 ms 348 KB Output is correct
52 Correct 1 ms 344 KB Output is correct
53 Correct 1 ms 348 KB Output is correct
54 Correct 1 ms 604 KB Output is correct
55 Correct 1 ms 604 KB Output is correct
56 Correct 108 ms 25884 KB Output is correct
57 Correct 179 ms 38344 KB Output is correct
58 Correct 161 ms 37576 KB Output is correct
59 Correct 0 ms 344 KB Output is correct
60 Correct 0 ms 348 KB Output is correct
61 Correct 0 ms 348 KB Output is correct
62 Correct 214 ms 61916 KB Output is correct
63 Correct 209 ms 60908 KB Output is correct
64 Correct 204 ms 63428 KB Output is correct
65 Correct 3 ms 856 KB Output is correct
66 Correct 3 ms 1116 KB Output is correct
67 Correct 106 ms 22284 KB Output is correct
68 Correct 183 ms 35936 KB Output is correct
69 Correct 305 ms 44416 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 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 1 ms 344 KB Output is correct
6 Correct 1 ms 344 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 86 ms 32980 KB Output is correct
10 Correct 7 ms 3676 KB Output is correct
11 Correct 38 ms 18380 KB Output is correct
12 Correct 12 ms 5300 KB Output is correct
13 Correct 17 ms 11372 KB Output is correct
14 Correct 1 ms 344 KB Output is correct
15 Correct 1 ms 604 KB Output is correct
16 Correct 84 ms 27944 KB Output is correct
17 Correct 291 ms 67776 KB Output is correct
18 Correct 308 ms 65404 KB Output is correct
19 Correct 267 ms 59772 KB Output is correct
20 Correct 235 ms 52092 KB Output is correct
21 Correct 226 ms 45436 KB Output is correct
22 Correct 0 ms 348 KB Output is correct
23 Correct 41 ms 6700 KB Output is correct
24 Correct 11 ms 3164 KB Output is correct
25 Correct 25 ms 6720 KB Output is correct
26 Correct 37 ms 10188 KB Output is correct
27 Correct 117 ms 22984 KB Output is correct
28 Correct 152 ms 29124 KB Output is correct
29 Correct 189 ms 34504 KB Output is correct
30 Correct 258 ms 42756 KB Output is correct
31 Correct 300 ms 46460 KB Output is correct
32 Correct 258 ms 55680 KB Output is correct
33 Correct 199 ms 67776 KB Output is correct
34 Correct 3 ms 1112 KB Output is correct
35 Correct 4 ms 1628 KB Output is correct
36 Correct 109 ms 24864 KB Output is correct
37 Correct 183 ms 37320 KB Output is correct
38 Correct 279 ms 50300 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 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 1 ms 344 KB Output is correct
6 Correct 1 ms 344 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 86 ms 32980 KB Output is correct
10 Correct 7 ms 3676 KB Output is correct
11 Correct 38 ms 18380 KB Output is correct
12 Correct 12 ms 5300 KB Output is correct
13 Correct 17 ms 11372 KB Output is correct
14 Correct 1 ms 344 KB Output is correct
15 Correct 1 ms 604 KB Output is correct
16 Correct 84 ms 27944 KB Output is correct
17 Correct 1 ms 348 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 0 ms 344 KB Output is correct
23 Correct 223 ms 57464 KB Output is correct
24 Correct 1 ms 344 KB Output is correct
25 Correct 1 ms 600 KB Output is correct
26 Correct 1 ms 860 KB Output is correct
27 Correct 2 ms 604 KB Output is correct
28 Correct 69 ms 22760 KB Output is correct
29 Correct 116 ms 32196 KB Output is correct
30 Correct 155 ms 44156 KB Output is correct
31 Correct 230 ms 55044 KB Output is correct
32 Correct 0 ms 348 KB Output is correct
33 Correct 0 ms 348 KB Output is correct
34 Correct 0 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 0 ms 348 KB Output is correct
38 Correct 0 ms 344 KB Output is correct
39 Correct 0 ms 344 KB Output is correct
40 Correct 0 ms 348 KB Output is correct
41 Correct 0 ms 348 KB Output is correct
42 Correct 0 ms 348 KB Output is correct
43 Correct 1 ms 776 KB Output is correct
44 Correct 1 ms 604 KB Output is correct
45 Correct 100 ms 25960 KB Output is correct
46 Correct 161 ms 38384 KB Output is correct
47 Correct 173 ms 37504 KB Output is correct
48 Correct 1 ms 600 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 348 KB Output is correct
53 Correct 0 ms 348 KB Output is correct
54 Correct 0 ms 344 KB Output is correct
55 Correct 262 ms 52460 KB Output is correct
56 Correct 0 ms 344 KB Output is correct
57 Correct 2 ms 860 KB Output is correct
58 Correct 5 ms 2140 KB Output is correct
59 Correct 3 ms 1624 KB Output is correct
60 Correct 89 ms 29032 KB Output is correct
61 Correct 135 ms 37832 KB Output is correct
62 Correct 190 ms 43076 KB Output is correct
63 Correct 229 ms 51324 KB Output is correct
64 Correct 1 ms 348 KB Output is correct
65 Correct 0 ms 344 KB Output is correct
66 Correct 0 ms 348 KB Output is correct
67 Correct 195 ms 61824 KB Output is correct
68 Correct 216 ms 61004 KB Output is correct
69 Correct 199 ms 63428 KB Output is correct
70 Correct 2 ms 860 KB Output is correct
71 Correct 4 ms 1260 KB Output is correct
72 Correct 116 ms 22456 KB Output is correct
73 Correct 185 ms 35780 KB Output is correct
74 Correct 291 ms 44672 KB Output is correct
75 Correct 378 ms 55680 KB Output is correct
76 Correct 211 ms 67660 KB Output is correct
77 Correct 3 ms 1116 KB Output is correct
78 Correct 4 ms 1628 KB Output is correct
79 Correct 116 ms 24632 KB Output is correct
80 Correct 196 ms 37196 KB Output is correct
81 Correct 374 ms 50144 KB Output is correct
82 Correct 0 ms 348 KB Output is correct
83 Correct 0 ms 348 KB Output is correct
84 Correct 0 ms 348 KB Output is correct
85 Correct 228 ms 59068 KB Output is correct
86 Correct 209 ms 54396 KB Output is correct
87 Correct 252 ms 51464 KB Output is correct
88 Correct 232 ms 46108 KB Output is correct
89 Correct 52 ms 13952 KB Output is correct
90 Correct 48 ms 14080 KB Output is correct
91 Correct 54 ms 14204 KB Output is correct
92 Correct 271 ms 44412 KB Output is correct
93 Correct 218 ms 44540 KB Output is correct
94 Correct 219 ms 44156 KB Output is correct
95 Correct 213 ms 44160 KB Output is correct
96 Correct 0 ms 344 KB Output is correct
97 Correct 16 ms 3604 KB Output is correct
98 Correct 24 ms 7228 KB Output is correct
99 Correct 242 ms 55308 KB Output is correct
100 Correct 5 ms 1368 KB Output is correct
101 Correct 18 ms 4968 KB Output is correct
102 Correct 34 ms 8400 KB Output is correct
103 Correct 103 ms 13360 KB Output is correct
104 Correct 124 ms 19656 KB Output is correct
105 Correct 164 ms 24004 KB Output is correct
106 Correct 214 ms 27332 KB Output is correct
107 Correct 241 ms 34172 KB Output is correct
108 Correct 0 ms 348 KB Output is correct
109 Correct 0 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 0 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 0 ms 344 KB Output is correct
116 Correct 0 ms 348 KB Output is correct
117 Correct 1 ms 344 KB Output is correct
118 Correct 1 ms 348 KB Output is correct
119 Correct 1 ms 604 KB Output is correct
120 Correct 1 ms 604 KB Output is correct
121 Correct 108 ms 25884 KB Output is correct
122 Correct 179 ms 38344 KB Output is correct
123 Correct 161 ms 37576 KB Output is correct
124 Correct 0 ms 344 KB Output is correct
125 Correct 0 ms 348 KB Output is correct
126 Correct 0 ms 348 KB Output is correct
127 Correct 214 ms 61916 KB Output is correct
128 Correct 209 ms 60908 KB Output is correct
129 Correct 204 ms 63428 KB Output is correct
130 Correct 3 ms 856 KB Output is correct
131 Correct 3 ms 1116 KB Output is correct
132 Correct 106 ms 22284 KB Output is correct
133 Correct 183 ms 35936 KB Output is correct
134 Correct 305 ms 44416 KB Output is correct
135 Correct 291 ms 67776 KB Output is correct
136 Correct 308 ms 65404 KB Output is correct
137 Correct 267 ms 59772 KB Output is correct
138 Correct 235 ms 52092 KB Output is correct
139 Correct 226 ms 45436 KB Output is correct
140 Correct 0 ms 348 KB Output is correct
141 Correct 41 ms 6700 KB Output is correct
142 Correct 11 ms 3164 KB Output is correct
143 Correct 25 ms 6720 KB Output is correct
144 Correct 37 ms 10188 KB Output is correct
145 Correct 117 ms 22984 KB Output is correct
146 Correct 152 ms 29124 KB Output is correct
147 Correct 189 ms 34504 KB Output is correct
148 Correct 258 ms 42756 KB Output is correct
149 Correct 300 ms 46460 KB Output is correct
150 Correct 258 ms 55680 KB Output is correct
151 Correct 199 ms 67776 KB Output is correct
152 Correct 3 ms 1112 KB Output is correct
153 Correct 4 ms 1628 KB Output is correct
154 Correct 109 ms 24864 KB Output is correct
155 Correct 183 ms 37320 KB Output is correct
156 Correct 279 ms 50300 KB Output is correct
157 Correct 0 ms 344 KB Output is correct
158 Correct 0 ms 348 KB Output is correct
159 Correct 0 ms 344 KB Output is correct
160 Correct 0 ms 348 KB Output is correct
161 Correct 282 ms 50196 KB Output is correct
162 Correct 207 ms 52852 KB Output is correct
163 Correct 211 ms 45696 KB Output is correct
164 Correct 206 ms 45296 KB Output is correct
165 Correct 260 ms 59504 KB Output is correct
166 Correct 276 ms 60372 KB Output is correct
167 Execution timed out 3543 ms 9824 KB Time limit exceeded
168 Halted 0 ms 0 KB -