Submission #707936

# Submission time Handle Problem Language Result Execution time Memory
707936 2023-03-10T14:27:49 Z LittleCube Road Closures (APIO21_roads) C++14
100 / 100
269 ms 48680 KB
#include "roads.h"
#include <bits/stdc++.h>
#define ll long long
#define pll pair<ll, ll>
#define F first
#define S second
using namespace std;

struct kset
{
    vector<pll> ops;
    multiset<ll, greater<ll>> ms;
    int sz;
    ll sum = 0;
    void resize(int n)
    {
        sz = n;
        while (ms.size() > sz && *ms.begin() >= 0)
        {
            sum -= *ms.begin();
            ms.erase(ms.begin());
        }
    }
    void insert(ll k)
    {
        ops.emplace_back(pll(1, k));
        sum += k;
        ms.insert(k);
        if (ms.size() > sz && *ms.begin() >= 0)
        {
            ops.emplace_back(pll(0, *ms.begin()));
            sum -= *ms.begin();
            ms.erase(ms.begin());
        }
    }
    void undo()
    {
        while (!ops.empty())
        {
            auto [t, k] = ops.back();
            ops.pop_back();
            if (t == 1)
            {
                ms.erase(ms.find(k));
                sum -= k;
            }
            else
            {
                ms.insert(k);
                sum += k;
            }
        }
    }
} opt[100005];
ll dp[100005][2], d[100005], vis[100005];
vector<pll> E[100005];

void dfs(int u, int p, int k)
{
    vis[u] = 1;
    ll tot = dp[u][0] = dp[u][1] = 0;
    opt[u].ops.clear();
    for (auto [v, w] : E[u])
        if (d[v] < k)
            break;
        else if (v != p)
        {
            dfs(v, u, k);
            tot += dp[v][1];
            opt[u].insert(dp[v][0] + w - dp[v][1]);
        }
    dp[u][0] = tot + opt[u].sum - max(*opt[u].ms.begin(), 0LL);
    dp[u][1] = tot + opt[u].sum;
    opt[u].undo();
}

vector<ll> minimum_closure_costs(int N, vector<int> U, vector<int> V, vector<int> W)
{
    vector<ll> ans(N);
    vector<int> cur, nxt;
    for (int i = 0; i < N; i++)
        cur.emplace_back(i);
    for (int i = 0; i < N - 1; i++)
    {
        ++d[U[i]], ++d[V[i]];
        E[U[i]].emplace_back(pll(V[i], W[i]));
        E[V[i]].emplace_back(pll(U[i], W[i]));
        ans[0] += W[i];
    }
    for (int i = 0; i < N; i++)
        sort(E[i].begin(), E[i].end(), [&](pll p1, pll p2)
             { return d[p1.F] > d[p2.F]; });

    for (int k = 1; k < N; k++)
    {
        for (auto i : cur)
        {
            vis[i] = 0;
            opt[i].resize(d[i] - k);
        }
        for (auto i : cur)
            if (!vis[i])
            {
                dfs(i, -1, k);
                ans[k] += dp[i][1];
            }
        nxt.clear();
        for (auto i : cur)
            if (d[i] == k)
            {
                for (auto [j, w] : E[i])
                    if (d[j] > d[i])
                        opt[j].insert(w);
            }
            else
                nxt.emplace_back(i);
        cur.swap(nxt);
    }
    return ans;
}

/*
5
0 1 1
0 2 4
0 3 3
2 4 2

4
0 1 5
2 0 10
0 3 5
*/

Compilation message

roads.cpp: In member function 'void kset::resize(int)':
roads.cpp:18:26: warning: comparison of integer expressions of different signedness: 'std::multiset<long long int, std::greater<long long int> >::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   18 |         while (ms.size() > sz && *ms.begin() >= 0)
      |                ~~~~~~~~~~^~~~
roads.cpp: In member function 'void kset::insert(long long int)':
roads.cpp:29:23: warning: comparison of integer expressions of different signedness: 'std::multiset<long long int, std::greater<long long int> >::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   29 |         if (ms.size() > sz && *ms.begin() >= 0)
      |             ~~~~~~~~~~^~~~
roads.cpp: In member function 'void kset::undo()':
roads.cpp:40:18: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
   40 |             auto [t, k] = ops.back();
      |                  ^
roads.cpp: In function 'void dfs(int, int, int)':
roads.cpp:63:15: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
   63 |     for (auto [v, w] : E[u])
      |               ^
roads.cpp: In function 'std::vector<long long int> minimum_closure_costs(int, std::vector<int>, std::vector<int>, std::vector<int>)':
roads.cpp:111:27: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
  111 |                 for (auto [j, w] : E[i])
      |                           ^
# Verdict Execution time Memory Grader output
1 Correct 7 ms 11220 KB Output is correct
2 Correct 8 ms 11668 KB Output is correct
3 Correct 8 ms 11604 KB Output is correct
4 Correct 7 ms 11604 KB Output is correct
5 Correct 6 ms 11204 KB Output is correct
6 Correct 6 ms 11220 KB Output is correct
7 Correct 7 ms 11260 KB Output is correct
8 Correct 8 ms 11544 KB Output is correct
9 Correct 7 ms 11604 KB Output is correct
10 Correct 6 ms 11220 KB Output is correct
11 Correct 6 ms 11220 KB Output is correct
12 Correct 76 ms 22416 KB Output is correct
13 Correct 152 ms 29808 KB Output is correct
14 Correct 153 ms 28476 KB Output is correct
15 Correct 158 ms 30360 KB Output is correct
16 Correct 190 ms 30596 KB Output is correct
17 Correct 140 ms 30708 KB Output is correct
18 Correct 6 ms 11220 KB Output is correct
19 Correct 122 ms 28092 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 6 ms 11164 KB Output is correct
2 Correct 90 ms 42212 KB Output is correct
3 Correct 114 ms 46240 KB Output is correct
4 Correct 101 ms 48512 KB Output is correct
5 Correct 98 ms 48644 KB Output is correct
6 Correct 8 ms 11860 KB Output is correct
7 Correct 8 ms 11988 KB Output is correct
8 Correct 8 ms 11904 KB Output is correct
9 Correct 7 ms 11268 KB Output is correct
10 Correct 7 ms 11348 KB Output is correct
11 Correct 6 ms 11276 KB Output is correct
12 Correct 58 ms 33144 KB Output is correct
13 Correct 101 ms 47760 KB Output is correct
14 Correct 7 ms 11256 KB Output is correct
15 Correct 84 ms 44212 KB Output is correct
16 Correct 103 ms 47800 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 6 ms 11268 KB Output is correct
2 Correct 6 ms 11220 KB Output is correct
3 Correct 7 ms 11260 KB Output is correct
4 Correct 6 ms 11272 KB Output is correct
5 Correct 7 ms 11220 KB Output is correct
6 Correct 8 ms 11220 KB Output is correct
7 Correct 6 ms 11276 KB Output is correct
8 Correct 7 ms 11220 KB Output is correct
9 Correct 7 ms 11220 KB Output is correct
10 Correct 6 ms 11220 KB Output is correct
11 Correct 7 ms 11472 KB Output is correct
12 Correct 6 ms 11348 KB Output is correct
13 Correct 6 ms 11220 KB Output is correct
14 Correct 6 ms 11268 KB Output is correct
15 Correct 6 ms 11220 KB Output is correct
16 Correct 6 ms 11220 KB Output is correct
17 Correct 6 ms 11220 KB Output is correct
18 Correct 6 ms 11220 KB Output is correct
19 Correct 7 ms 11220 KB Output is correct
20 Correct 6 ms 11220 KB Output is correct
21 Correct 6 ms 11220 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 6 ms 11268 KB Output is correct
2 Correct 6 ms 11220 KB Output is correct
3 Correct 7 ms 11260 KB Output is correct
4 Correct 6 ms 11272 KB Output is correct
5 Correct 7 ms 11220 KB Output is correct
6 Correct 8 ms 11220 KB Output is correct
7 Correct 6 ms 11276 KB Output is correct
8 Correct 7 ms 11220 KB Output is correct
9 Correct 7 ms 11220 KB Output is correct
10 Correct 6 ms 11220 KB Output is correct
11 Correct 7 ms 11472 KB Output is correct
12 Correct 6 ms 11348 KB Output is correct
13 Correct 6 ms 11220 KB Output is correct
14 Correct 6 ms 11268 KB Output is correct
15 Correct 6 ms 11220 KB Output is correct
16 Correct 6 ms 11220 KB Output is correct
17 Correct 6 ms 11220 KB Output is correct
18 Correct 6 ms 11220 KB Output is correct
19 Correct 7 ms 11220 KB Output is correct
20 Correct 6 ms 11220 KB Output is correct
21 Correct 6 ms 11220 KB Output is correct
22 Correct 6 ms 11272 KB Output is correct
23 Correct 7 ms 11428 KB Output is correct
24 Correct 9 ms 11668 KB Output is correct
25 Correct 8 ms 11500 KB Output is correct
26 Correct 7 ms 11604 KB Output is correct
27 Correct 8 ms 11616 KB Output is correct
28 Correct 7 ms 11604 KB Output is correct
29 Correct 7 ms 11604 KB Output is correct
30 Correct 8 ms 11664 KB Output is correct
31 Correct 8 ms 11664 KB Output is correct
32 Correct 8 ms 11624 KB Output is correct
33 Correct 8 ms 11860 KB Output is correct
34 Correct 8 ms 12052 KB Output is correct
35 Correct 7 ms 11988 KB Output is correct
36 Correct 8 ms 11604 KB Output is correct
37 Correct 8 ms 11620 KB Output is correct
38 Correct 8 ms 11596 KB Output is correct
39 Correct 6 ms 11220 KB Output is correct
40 Correct 7 ms 11220 KB Output is correct
41 Correct 6 ms 11296 KB Output is correct
42 Correct 6 ms 11268 KB Output is correct
43 Correct 7 ms 11220 KB Output is correct
44 Correct 8 ms 11272 KB Output is correct
45 Correct 6 ms 11220 KB Output is correct
46 Correct 6 ms 11220 KB Output is correct
47 Correct 6 ms 11280 KB Output is correct
48 Correct 6 ms 11268 KB Output is correct
49 Correct 6 ms 11348 KB Output is correct
50 Correct 6 ms 11272 KB Output is correct
51 Correct 6 ms 11268 KB Output is correct
52 Correct 6 ms 11272 KB Output is correct
53 Correct 9 ms 11476 KB Output is correct
54 Correct 10 ms 11604 KB Output is correct
55 Correct 9 ms 11704 KB Output is correct
56 Correct 7 ms 11600 KB Output is correct
57 Correct 8 ms 11604 KB Output is correct
58 Correct 6 ms 11220 KB Output is correct
59 Correct 8 ms 11272 KB Output is correct
60 Correct 6 ms 11220 KB Output is correct
61 Correct 6 ms 11272 KB Output is correct
62 Correct 6 ms 11288 KB Output is correct
63 Correct 6 ms 11276 KB Output is correct
64 Correct 8 ms 11616 KB Output is correct
65 Correct 8 ms 11660 KB Output is correct
66 Correct 8 ms 11668 KB Output is correct
67 Correct 9 ms 11540 KB Output is correct
68 Correct 9 ms 11664 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 171 ms 29620 KB Output is correct
2 Correct 163 ms 29248 KB Output is correct
3 Correct 181 ms 32068 KB Output is correct
4 Correct 178 ms 30360 KB Output is correct
5 Correct 156 ms 32256 KB Output is correct
6 Correct 154 ms 30212 KB Output is correct
7 Correct 200 ms 30428 KB Output is correct
8 Correct 136 ms 28712 KB Output is correct
9 Correct 187 ms 36116 KB Output is correct
10 Correct 171 ms 29172 KB Output is correct
11 Correct 269 ms 31472 KB Output is correct
12 Correct 134 ms 30352 KB Output is correct
13 Correct 6 ms 11268 KB Output is correct
14 Correct 128 ms 44192 KB Output is correct
15 Correct 129 ms 47752 KB Output is correct
16 Correct 8 ms 11604 KB Output is correct
17 Correct 8 ms 11604 KB Output is correct
18 Correct 8 ms 11604 KB Output is correct
19 Correct 8 ms 11604 KB Output is correct
20 Correct 7 ms 11604 KB Output is correct
21 Correct 114 ms 28008 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 171 ms 29620 KB Output is correct
2 Correct 163 ms 29248 KB Output is correct
3 Correct 181 ms 32068 KB Output is correct
4 Correct 178 ms 30360 KB Output is correct
5 Correct 156 ms 32256 KB Output is correct
6 Correct 154 ms 30212 KB Output is correct
7 Correct 200 ms 30428 KB Output is correct
8 Correct 136 ms 28712 KB Output is correct
9 Correct 187 ms 36116 KB Output is correct
10 Correct 171 ms 29172 KB Output is correct
11 Correct 269 ms 31472 KB Output is correct
12 Correct 134 ms 30352 KB Output is correct
13 Correct 6 ms 11268 KB Output is correct
14 Correct 128 ms 44192 KB Output is correct
15 Correct 129 ms 47752 KB Output is correct
16 Correct 8 ms 11604 KB Output is correct
17 Correct 8 ms 11604 KB Output is correct
18 Correct 8 ms 11604 KB Output is correct
19 Correct 8 ms 11604 KB Output is correct
20 Correct 7 ms 11604 KB Output is correct
21 Correct 114 ms 28008 KB Output is correct
22 Correct 6 ms 11220 KB Output is correct
23 Correct 7 ms 11220 KB Output is correct
24 Correct 6 ms 11220 KB Output is correct
25 Correct 179 ms 27580 KB Output is correct
26 Correct 151 ms 26000 KB Output is correct
27 Correct 206 ms 30300 KB Output is correct
28 Correct 240 ms 32108 KB Output is correct
29 Correct 175 ms 30544 KB Output is correct
30 Correct 195 ms 29572 KB Output is correct
31 Correct 209 ms 30196 KB Output is correct
32 Correct 192 ms 28172 KB Output is correct
33 Correct 139 ms 29112 KB Output is correct
34 Correct 239 ms 30468 KB Output is correct
35 Correct 235 ms 36492 KB Output is correct
36 Correct 223 ms 31460 KB Output is correct
37 Correct 210 ms 30512 KB Output is correct
38 Correct 61 ms 33216 KB Output is correct
39 Correct 110 ms 47752 KB Output is correct
40 Correct 7 ms 11476 KB Output is correct
41 Correct 9 ms 11664 KB Output is correct
42 Correct 10 ms 11604 KB Output is correct
43 Correct 8 ms 11508 KB Output is correct
44 Correct 8 ms 11604 KB Output is correct
45 Correct 7 ms 11280 KB Output is correct
46 Correct 6 ms 11268 KB Output is correct
47 Correct 6 ms 11220 KB Output is correct
48 Correct 10 ms 11220 KB Output is correct
49 Correct 7 ms 11272 KB Output is correct
50 Correct 81 ms 22396 KB Output is correct
51 Correct 181 ms 29836 KB Output is correct
52 Correct 198 ms 29548 KB Output is correct
53 Correct 195 ms 29296 KB Output is correct
54 Correct 207 ms 32132 KB Output is correct
55 Correct 194 ms 30220 KB Output is correct
56 Correct 163 ms 32124 KB Output is correct
57 Correct 166 ms 30216 KB Output is correct
58 Correct 211 ms 30584 KB Output is correct
59 Correct 117 ms 28720 KB Output is correct
60 Correct 172 ms 36128 KB Output is correct
61 Correct 192 ms 29164 KB Output is correct
62 Correct 173 ms 31492 KB Output is correct
63 Correct 149 ms 30336 KB Output is correct
64 Correct 6 ms 11248 KB Output is correct
65 Correct 101 ms 44168 KB Output is correct
66 Correct 95 ms 47764 KB Output is correct
67 Correct 8 ms 11604 KB Output is correct
68 Correct 9 ms 11664 KB Output is correct
69 Correct 9 ms 11604 KB Output is correct
70 Correct 7 ms 11540 KB Output is correct
71 Correct 8 ms 11604 KB Output is correct
72 Correct 122 ms 28016 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 7 ms 11220 KB Output is correct
2 Correct 8 ms 11668 KB Output is correct
3 Correct 8 ms 11604 KB Output is correct
4 Correct 7 ms 11604 KB Output is correct
5 Correct 6 ms 11204 KB Output is correct
6 Correct 6 ms 11220 KB Output is correct
7 Correct 7 ms 11260 KB Output is correct
8 Correct 8 ms 11544 KB Output is correct
9 Correct 7 ms 11604 KB Output is correct
10 Correct 6 ms 11220 KB Output is correct
11 Correct 6 ms 11220 KB Output is correct
12 Correct 76 ms 22416 KB Output is correct
13 Correct 152 ms 29808 KB Output is correct
14 Correct 153 ms 28476 KB Output is correct
15 Correct 158 ms 30360 KB Output is correct
16 Correct 190 ms 30596 KB Output is correct
17 Correct 140 ms 30708 KB Output is correct
18 Correct 6 ms 11220 KB Output is correct
19 Correct 122 ms 28092 KB Output is correct
20 Correct 6 ms 11164 KB Output is correct
21 Correct 90 ms 42212 KB Output is correct
22 Correct 114 ms 46240 KB Output is correct
23 Correct 101 ms 48512 KB Output is correct
24 Correct 98 ms 48644 KB Output is correct
25 Correct 8 ms 11860 KB Output is correct
26 Correct 8 ms 11988 KB Output is correct
27 Correct 8 ms 11904 KB Output is correct
28 Correct 7 ms 11268 KB Output is correct
29 Correct 7 ms 11348 KB Output is correct
30 Correct 6 ms 11276 KB Output is correct
31 Correct 58 ms 33144 KB Output is correct
32 Correct 101 ms 47760 KB Output is correct
33 Correct 7 ms 11256 KB Output is correct
34 Correct 84 ms 44212 KB Output is correct
35 Correct 103 ms 47800 KB Output is correct
36 Correct 6 ms 11268 KB Output is correct
37 Correct 6 ms 11220 KB Output is correct
38 Correct 7 ms 11260 KB Output is correct
39 Correct 6 ms 11272 KB Output is correct
40 Correct 7 ms 11220 KB Output is correct
41 Correct 8 ms 11220 KB Output is correct
42 Correct 6 ms 11276 KB Output is correct
43 Correct 7 ms 11220 KB Output is correct
44 Correct 7 ms 11220 KB Output is correct
45 Correct 6 ms 11220 KB Output is correct
46 Correct 7 ms 11472 KB Output is correct
47 Correct 6 ms 11348 KB Output is correct
48 Correct 6 ms 11220 KB Output is correct
49 Correct 6 ms 11268 KB Output is correct
50 Correct 6 ms 11220 KB Output is correct
51 Correct 6 ms 11220 KB Output is correct
52 Correct 6 ms 11220 KB Output is correct
53 Correct 6 ms 11220 KB Output is correct
54 Correct 7 ms 11220 KB Output is correct
55 Correct 6 ms 11220 KB Output is correct
56 Correct 6 ms 11220 KB Output is correct
57 Correct 6 ms 11272 KB Output is correct
58 Correct 7 ms 11428 KB Output is correct
59 Correct 9 ms 11668 KB Output is correct
60 Correct 8 ms 11500 KB Output is correct
61 Correct 7 ms 11604 KB Output is correct
62 Correct 8 ms 11616 KB Output is correct
63 Correct 7 ms 11604 KB Output is correct
64 Correct 7 ms 11604 KB Output is correct
65 Correct 8 ms 11664 KB Output is correct
66 Correct 8 ms 11664 KB Output is correct
67 Correct 8 ms 11624 KB Output is correct
68 Correct 8 ms 11860 KB Output is correct
69 Correct 8 ms 12052 KB Output is correct
70 Correct 7 ms 11988 KB Output is correct
71 Correct 8 ms 11604 KB Output is correct
72 Correct 8 ms 11620 KB Output is correct
73 Correct 8 ms 11596 KB Output is correct
74 Correct 6 ms 11220 KB Output is correct
75 Correct 7 ms 11220 KB Output is correct
76 Correct 6 ms 11296 KB Output is correct
77 Correct 6 ms 11268 KB Output is correct
78 Correct 7 ms 11220 KB Output is correct
79 Correct 8 ms 11272 KB Output is correct
80 Correct 6 ms 11220 KB Output is correct
81 Correct 6 ms 11220 KB Output is correct
82 Correct 6 ms 11280 KB Output is correct
83 Correct 6 ms 11268 KB Output is correct
84 Correct 6 ms 11348 KB Output is correct
85 Correct 6 ms 11272 KB Output is correct
86 Correct 6 ms 11268 KB Output is correct
87 Correct 6 ms 11272 KB Output is correct
88 Correct 9 ms 11476 KB Output is correct
89 Correct 10 ms 11604 KB Output is correct
90 Correct 9 ms 11704 KB Output is correct
91 Correct 7 ms 11600 KB Output is correct
92 Correct 8 ms 11604 KB Output is correct
93 Correct 6 ms 11220 KB Output is correct
94 Correct 8 ms 11272 KB Output is correct
95 Correct 6 ms 11220 KB Output is correct
96 Correct 6 ms 11272 KB Output is correct
97 Correct 6 ms 11288 KB Output is correct
98 Correct 6 ms 11276 KB Output is correct
99 Correct 8 ms 11616 KB Output is correct
100 Correct 8 ms 11660 KB Output is correct
101 Correct 8 ms 11668 KB Output is correct
102 Correct 9 ms 11540 KB Output is correct
103 Correct 9 ms 11664 KB Output is correct
104 Correct 171 ms 29620 KB Output is correct
105 Correct 163 ms 29248 KB Output is correct
106 Correct 181 ms 32068 KB Output is correct
107 Correct 178 ms 30360 KB Output is correct
108 Correct 156 ms 32256 KB Output is correct
109 Correct 154 ms 30212 KB Output is correct
110 Correct 200 ms 30428 KB Output is correct
111 Correct 136 ms 28712 KB Output is correct
112 Correct 187 ms 36116 KB Output is correct
113 Correct 171 ms 29172 KB Output is correct
114 Correct 269 ms 31472 KB Output is correct
115 Correct 134 ms 30352 KB Output is correct
116 Correct 6 ms 11268 KB Output is correct
117 Correct 128 ms 44192 KB Output is correct
118 Correct 129 ms 47752 KB Output is correct
119 Correct 8 ms 11604 KB Output is correct
120 Correct 8 ms 11604 KB Output is correct
121 Correct 8 ms 11604 KB Output is correct
122 Correct 8 ms 11604 KB Output is correct
123 Correct 7 ms 11604 KB Output is correct
124 Correct 114 ms 28008 KB Output is correct
125 Correct 6 ms 11220 KB Output is correct
126 Correct 7 ms 11220 KB Output is correct
127 Correct 6 ms 11220 KB Output is correct
128 Correct 179 ms 27580 KB Output is correct
129 Correct 151 ms 26000 KB Output is correct
130 Correct 206 ms 30300 KB Output is correct
131 Correct 240 ms 32108 KB Output is correct
132 Correct 175 ms 30544 KB Output is correct
133 Correct 195 ms 29572 KB Output is correct
134 Correct 209 ms 30196 KB Output is correct
135 Correct 192 ms 28172 KB Output is correct
136 Correct 139 ms 29112 KB Output is correct
137 Correct 239 ms 30468 KB Output is correct
138 Correct 235 ms 36492 KB Output is correct
139 Correct 223 ms 31460 KB Output is correct
140 Correct 210 ms 30512 KB Output is correct
141 Correct 61 ms 33216 KB Output is correct
142 Correct 110 ms 47752 KB Output is correct
143 Correct 7 ms 11476 KB Output is correct
144 Correct 9 ms 11664 KB Output is correct
145 Correct 10 ms 11604 KB Output is correct
146 Correct 8 ms 11508 KB Output is correct
147 Correct 8 ms 11604 KB Output is correct
148 Correct 7 ms 11280 KB Output is correct
149 Correct 6 ms 11268 KB Output is correct
150 Correct 6 ms 11220 KB Output is correct
151 Correct 10 ms 11220 KB Output is correct
152 Correct 7 ms 11272 KB Output is correct
153 Correct 81 ms 22396 KB Output is correct
154 Correct 181 ms 29836 KB Output is correct
155 Correct 198 ms 29548 KB Output is correct
156 Correct 195 ms 29296 KB Output is correct
157 Correct 207 ms 32132 KB Output is correct
158 Correct 194 ms 30220 KB Output is correct
159 Correct 163 ms 32124 KB Output is correct
160 Correct 166 ms 30216 KB Output is correct
161 Correct 211 ms 30584 KB Output is correct
162 Correct 117 ms 28720 KB Output is correct
163 Correct 172 ms 36128 KB Output is correct
164 Correct 192 ms 29164 KB Output is correct
165 Correct 173 ms 31492 KB Output is correct
166 Correct 149 ms 30336 KB Output is correct
167 Correct 6 ms 11248 KB Output is correct
168 Correct 101 ms 44168 KB Output is correct
169 Correct 95 ms 47764 KB Output is correct
170 Correct 8 ms 11604 KB Output is correct
171 Correct 9 ms 11664 KB Output is correct
172 Correct 9 ms 11604 KB Output is correct
173 Correct 7 ms 11540 KB Output is correct
174 Correct 8 ms 11604 KB Output is correct
175 Correct 122 ms 28016 KB Output is correct
176 Correct 6 ms 11272 KB Output is correct
177 Correct 189 ms 30800 KB Output is correct
178 Correct 170 ms 26472 KB Output is correct
179 Correct 179 ms 32120 KB Output is correct
180 Correct 165 ms 31552 KB Output is correct
181 Correct 165 ms 33128 KB Output is correct
182 Correct 153 ms 32196 KB Output is correct
183 Correct 182 ms 30636 KB Output is correct
184 Correct 157 ms 30508 KB Output is correct
185 Correct 177 ms 30288 KB Output is correct
186 Correct 157 ms 29636 KB Output is correct
187 Correct 161 ms 30928 KB Output is correct
188 Correct 168 ms 29400 KB Output is correct
189 Correct 172 ms 29032 KB Output is correct
190 Correct 171 ms 32332 KB Output is correct
191 Correct 163 ms 31420 KB Output is correct
192 Correct 164 ms 31232 KB Output is correct
193 Correct 170 ms 31136 KB Output is correct
194 Correct 182 ms 32404 KB Output is correct
195 Correct 82 ms 42284 KB Output is correct
196 Correct 94 ms 46252 KB Output is correct
197 Correct 98 ms 48572 KB Output is correct
198 Correct 110 ms 48680 KB Output is correct
199 Correct 7 ms 11464 KB Output is correct
200 Correct 8 ms 11672 KB Output is correct
201 Correct 8 ms 11536 KB Output is correct
202 Correct 7 ms 11664 KB Output is correct
203 Correct 8 ms 11676 KB Output is correct
204 Correct 9 ms 11604 KB Output is correct
205 Correct 9 ms 11604 KB Output is correct
206 Correct 11 ms 11672 KB Output is correct
207 Correct 9 ms 11604 KB Output is correct
208 Correct 9 ms 11604 KB Output is correct
209 Correct 8 ms 11860 KB Output is correct
210 Correct 8 ms 11968 KB Output is correct
211 Correct 7 ms 11988 KB Output is correct
212 Correct 8 ms 11664 KB Output is correct
213 Correct 8 ms 11580 KB Output is correct
214 Correct 8 ms 11604 KB Output is correct
215 Correct 6 ms 11220 KB Output is correct
216 Correct 6 ms 11220 KB Output is correct
217 Correct 6 ms 11220 KB Output is correct
218 Correct 6 ms 11272 KB Output is correct
219 Correct 7 ms 11216 KB Output is correct
220 Correct 6 ms 11220 KB Output is correct
221 Correct 7 ms 11268 KB Output is correct
222 Correct 6 ms 11220 KB Output is correct
223 Correct 7 ms 11352 KB Output is correct
224 Correct 6 ms 11272 KB Output is correct
225 Correct 6 ms 11276 KB Output is correct
226 Correct 6 ms 11268 KB Output is correct
227 Correct 6 ms 11220 KB Output is correct
228 Correct 6 ms 11288 KB Output is correct
229 Correct 136 ms 27524 KB Output is correct
230 Correct 131 ms 26000 KB Output is correct
231 Correct 183 ms 30288 KB Output is correct
232 Correct 191 ms 32128 KB Output is correct
233 Correct 149 ms 30584 KB Output is correct
234 Correct 167 ms 29492 KB Output is correct
235 Correct 159 ms 30228 KB Output is correct
236 Correct 170 ms 28064 KB Output is correct
237 Correct 141 ms 29152 KB Output is correct
238 Correct 187 ms 30496 KB Output is correct
239 Correct 187 ms 36432 KB Output is correct
240 Correct 184 ms 31428 KB Output is correct
241 Correct 159 ms 30400 KB Output is correct
242 Correct 59 ms 33180 KB Output is correct
243 Correct 92 ms 47748 KB Output is correct
244 Correct 7 ms 11476 KB Output is correct
245 Correct 8 ms 11604 KB Output is correct
246 Correct 9 ms 11704 KB Output is correct
247 Correct 7 ms 11512 KB Output is correct
248 Correct 7 ms 11604 KB Output is correct
249 Correct 6 ms 11220 KB Output is correct
250 Correct 6 ms 11220 KB Output is correct
251 Correct 6 ms 11220 KB Output is correct
252 Correct 6 ms 11220 KB Output is correct
253 Correct 6 ms 11216 KB Output is correct
254 Correct 76 ms 22452 KB Output is correct
255 Correct 134 ms 29828 KB Output is correct
256 Correct 146 ms 28536 KB Output is correct
257 Correct 182 ms 30332 KB Output is correct
258 Correct 162 ms 30632 KB Output is correct
259 Correct 136 ms 30780 KB Output is correct
260 Correct 203 ms 29648 KB Output is correct
261 Correct 161 ms 29276 KB Output is correct
262 Correct 179 ms 32120 KB Output is correct
263 Correct 201 ms 30148 KB Output is correct
264 Correct 156 ms 32144 KB Output is correct
265 Correct 150 ms 30256 KB Output is correct
266 Correct 204 ms 30556 KB Output is correct
267 Correct 120 ms 28744 KB Output is correct
268 Correct 166 ms 36192 KB Output is correct
269 Correct 185 ms 29180 KB Output is correct
270 Correct 175 ms 31432 KB Output is correct
271 Correct 139 ms 30352 KB Output is correct
272 Correct 6 ms 11272 KB Output is correct
273 Correct 91 ms 44272 KB Output is correct
274 Correct 90 ms 47960 KB Output is correct
275 Correct 7 ms 11664 KB Output is correct
276 Correct 8 ms 11604 KB Output is correct
277 Correct 8 ms 11668 KB Output is correct
278 Correct 8 ms 11536 KB Output is correct
279 Correct 8 ms 11688 KB Output is correct
280 Correct 115 ms 28056 KB Output is correct