답안 #412323

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
412323 2021-05-26T17:20:23 Z model_code 도로 폐쇄 (APIO21_roads) C++17
100 / 100
295 ms 42292 KB
#include "roads.h"
#include <bits/stdc++.h>

std::vector<std::priority_queue<long long>> used_edges, free_edges;
std::vector<std::vector<long long>> neighbouring_edges;
std::vector<int> last_limit, degree;
std::vector<long long> full_dp, partial_dp, used_sum;
std::vector<std::set<std::pair<int, int>>> tree;

long long get(int v, int limit) {
  if (limit <= 0)
    return 0;
  auto & used_pq = used_edges[v];
  auto & free_pq = free_edges[v];
  auto & sum = used_sum[v];
  while ((int)used_pq.size() > limit) {
    int w = -used_pq.top();
    used_pq.pop();
    sum -= w;
    free_pq.push(w);
  }
  while ((int)used_pq.size() < limit && free_pq.size() > 0) {
    int w = free_pq.top();
    free_pq.pop();
    sum += w;
    used_pq.push(-w);
  }
  while (used_pq.size() > 0 && free_pq.size() > 0 &&
      -used_pq.top() < free_pq.top()) {
    sum += free_pq.top() + used_pq.top();
    used_pq.push(-free_pq.top());
    free_pq.push(-used_pq.top());
    used_pq.pop();
    free_pq.pop();
  }
  int remaining_slots = limit - used_pq.size();
  long long ans = sum;
  for (long long x : neighbouring_edges[v]) {
    if (x < 0) break;
    if (remaining_slots > 0) {
      ans += x;
      --remaining_slots;
      continue;
    }
    if (used_pq.size() > 0 && -used_pq.top() < x) {
      ans += x + used_pq.top();
      sum += used_pq.top();
      free_pq.push(-used_pq.top());
      used_pq.pop();
    }
  }
  return ans;
}

void dfs(int v, int par, int limit) {
  assert(degree[v] > limit);
  last_limit[v] = limit;
  full_dp[v] = partial_dp[v] = 0;
  neighbouring_edges[v].clear();
  for (auto & e : tree[v]) {
    int u, w;
    std::tie(u, w) = e;
    if (u == par) continue;
    dfs(u, v, limit);
    partial_dp[v] += full_dp[u];
    neighbouring_edges[v].push_back(w + partial_dp[u] - full_dp[u]);
  }
  sort(neighbouring_edges[v].rbegin(), neighbouring_edges[v].rend());
  long long cursum = partial_dp[v];
  partial_dp[v] = cursum + get(v, limit-1);
  full_dp[v] = cursum + get(v, limit);
}

std::vector<long long> minimum_closure_costs(int N, std::vector<int> U,
                                             std::vector<int> V,
                                             std::vector<int> W) {
  free_edges.resize(N);
  used_edges.resize(N);
  neighbouring_edges.resize(N);
  last_limit.resize(N, 0);
  long long total = std::accumulate(W.begin(), W.end(), 0LL);
  full_dp.resize(N);
  partial_dp.resize(N);
  used_sum.resize(N, 0);
  tree.resize(N);
  for (int i = 0; i < N-1; ++i) {
    tree[U[i]].insert({V[i], W[i]});
    tree[V[i]].insert({U[i], W[i]});
  }
  degree.resize(N);
  for (int i = 0; i < N; ++i)
    degree[i] = tree[i].size();
  std::vector<int> nodes(N);
  std::iota(nodes.begin(), nodes.end(), 0);
  std::sort(nodes.begin(), nodes.end(), [&](int lef, int rig) {
    return degree[lef] > degree[rig];
  });
  int last = N-1;
  long long totally_free = 0;
  std::vector<long long> ans(N, total);
  for (int k = 1; k < N; ++k) {
    while (last >= 0 && degree[nodes[last]] <= k) {
      int v = nodes[last];
      for (auto & e : tree[v]) {
        int u, w;
        std::tie(u, w) = e;
        assert(tree[u].count({v, w}));
        tree[u].erase({v, w});
        free_edges[u].push(w);
      }
      while (!free_edges[v].empty()) {
        totally_free += free_edges[v].top();
        free_edges[v].pop();
      }
      totally_free += used_sum[v];
      tree[v].clear();
      --last;
    }
    ans[k] -= totally_free;
    for (int v : nodes) {
      if (degree[v] <= k) break;
      if (last_limit[v] >= k) continue;
      dfs(v, v, k);
      ans[k] -= full_dp[v];
    }
  }
  return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 3 ms 844 KB Output is correct
3 Correct 4 ms 844 KB Output is correct
4 Correct 3 ms 844 KB Output is correct
5 Correct 1 ms 332 KB Output is correct
6 Correct 1 ms 332 KB Output is correct
7 Correct 1 ms 332 KB Output is correct
8 Correct 3 ms 716 KB Output is correct
9 Correct 3 ms 844 KB Output is correct
10 Correct 1 ms 332 KB Output is correct
11 Correct 1 ms 332 KB Output is correct
12 Correct 104 ms 18500 KB Output is correct
13 Correct 188 ms 30712 KB Output is correct
14 Correct 171 ms 27464 KB Output is correct
15 Correct 192 ms 30376 KB Output is correct
16 Correct 206 ms 30784 KB Output is correct
17 Correct 186 ms 30764 KB Output is correct
18 Correct 1 ms 204 KB Output is correct
19 Correct 160 ms 27952 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 93 ms 35080 KB Output is correct
3 Correct 129 ms 39492 KB Output is correct
4 Correct 120 ms 42156 KB Output is correct
5 Correct 113 ms 42172 KB Output is correct
6 Correct 3 ms 972 KB Output is correct
7 Correct 3 ms 1076 KB Output is correct
8 Correct 3 ms 972 KB Output is correct
9 Correct 1 ms 332 KB Output is correct
10 Correct 1 ms 332 KB Output is correct
11 Correct 1 ms 332 KB Output is correct
12 Correct 62 ms 25452 KB Output is correct
13 Correct 107 ms 42180 KB Output is correct
14 Correct 1 ms 204 KB Output is correct
15 Correct 94 ms 37952 KB Output is correct
16 Correct 107 ms 42176 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 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 332 KB Output is correct
5 Correct 1 ms 332 KB Output is correct
6 Correct 1 ms 332 KB Output is correct
7 Correct 1 ms 332 KB Output is correct
8 Correct 1 ms 332 KB Output is correct
9 Correct 1 ms 332 KB Output is correct
10 Correct 1 ms 332 KB Output is correct
11 Correct 1 ms 332 KB Output is correct
12 Correct 1 ms 332 KB Output is correct
13 Correct 1 ms 332 KB Output is correct
14 Correct 1 ms 228 KB Output is correct
15 Correct 1 ms 332 KB Output is correct
16 Correct 1 ms 204 KB Output is correct
17 Correct 1 ms 332 KB Output is correct
18 Correct 1 ms 332 KB Output is correct
19 Correct 1 ms 332 KB Output is correct
20 Correct 1 ms 332 KB Output is correct
21 Correct 1 ms 204 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 3 ms 588 KB Output is correct
3 Correct 4 ms 844 KB Output is correct
4 Correct 3 ms 844 KB Output is correct
5 Correct 3 ms 844 KB Output is correct
6 Correct 3 ms 844 KB Output is correct
7 Correct 3 ms 844 KB Output is correct
8 Correct 3 ms 844 KB Output is correct
9 Correct 3 ms 844 KB Output is correct
10 Correct 3 ms 844 KB Output is correct
11 Correct 3 ms 912 KB Output is correct
12 Correct 3 ms 972 KB Output is correct
13 Correct 4 ms 1100 KB Output is correct
14 Correct 3 ms 972 KB Output is correct
15 Correct 3 ms 844 KB Output is correct
16 Correct 3 ms 844 KB Output is correct
17 Correct 3 ms 844 KB Output is correct
18 Correct 1 ms 204 KB Output is correct
19 Correct 3 ms 204 KB Output is correct
20 Correct 1 ms 332 KB Output is correct
21 Correct 1 ms 332 KB Output is correct
22 Correct 1 ms 332 KB Output is correct
23 Correct 1 ms 332 KB Output is correct
24 Correct 2 ms 384 KB Output is correct
25 Correct 1 ms 332 KB Output is correct
26 Correct 1 ms 332 KB Output is correct
27 Correct 1 ms 332 KB Output is correct
28 Correct 1 ms 332 KB Output is correct
29 Correct 2 ms 204 KB Output is correct
30 Correct 2 ms 332 KB Output is correct
31 Correct 1 ms 332 KB Output is correct
32 Correct 4 ms 716 KB Output is correct
33 Correct 5 ms 844 KB Output is correct
34 Correct 3 ms 844 KB Output is correct
35 Correct 3 ms 716 KB Output is correct
36 Correct 5 ms 844 KB Output is correct
37 Correct 1 ms 204 KB Output is correct
38 Correct 1 ms 332 KB Output is correct
39 Correct 1 ms 332 KB Output is correct
40 Correct 2 ms 332 KB Output is correct
41 Correct 2 ms 332 KB Output is correct
42 Correct 1 ms 204 KB Output is correct
43 Correct 3 ms 844 KB Output is correct
44 Correct 3 ms 844 KB Output is correct
45 Correct 5 ms 844 KB Output is correct
46 Correct 5 ms 844 KB Output is correct
47 Correct 3 ms 844 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 248 ms 28840 KB Output is correct
2 Correct 267 ms 28300 KB Output is correct
3 Correct 194 ms 31068 KB Output is correct
4 Correct 243 ms 29764 KB Output is correct
5 Correct 211 ms 31032 KB Output is correct
6 Correct 195 ms 30532 KB Output is correct
7 Correct 238 ms 31344 KB Output is correct
8 Correct 151 ms 28484 KB Output is correct
9 Correct 260 ms 31036 KB Output is correct
10 Correct 251 ms 28944 KB Output is correct
11 Correct 205 ms 30788 KB Output is correct
12 Correct 213 ms 30548 KB Output is correct
13 Correct 2 ms 204 KB Output is correct
14 Correct 93 ms 37944 KB Output is correct
15 Correct 126 ms 42160 KB Output is correct
16 Correct 3 ms 844 KB Output is correct
17 Correct 3 ms 844 KB Output is correct
18 Correct 3 ms 844 KB Output is correct
19 Correct 3 ms 844 KB Output is correct
20 Correct 3 ms 844 KB Output is correct
21 Correct 166 ms 27928 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 232 ms 25540 KB Output is correct
5 Correct 190 ms 23124 KB Output is correct
6 Correct 268 ms 29844 KB Output is correct
7 Correct 243 ms 31044 KB Output is correct
8 Correct 215 ms 28612 KB Output is correct
9 Correct 200 ms 29328 KB Output is correct
10 Correct 200 ms 30384 KB Output is correct
11 Correct 226 ms 27284 KB Output is correct
12 Correct 170 ms 29168 KB Output is correct
13 Correct 261 ms 31372 KB Output is correct
14 Correct 295 ms 33440 KB Output is correct
15 Correct 233 ms 30696 KB Output is correct
16 Correct 188 ms 30584 KB Output is correct
17 Correct 63 ms 25444 KB Output is correct
18 Correct 113 ms 42168 KB Output is correct
19 Correct 3 ms 716 KB Output is correct
20 Correct 4 ms 844 KB Output is correct
21 Correct 4 ms 844 KB Output is correct
22 Correct 4 ms 716 KB Output is correct
23 Correct 4 ms 916 KB Output is correct
24 Correct 1 ms 204 KB Output is correct
25 Correct 1 ms 332 KB Output is correct
26 Correct 1 ms 332 KB Output is correct
27 Correct 1 ms 332 KB Output is correct
28 Correct 1 ms 332 KB Output is correct
29 Correct 120 ms 18600 KB Output is correct
30 Correct 192 ms 30788 KB Output is correct
31 Correct 248 ms 28896 KB Output is correct
32 Correct 228 ms 28292 KB Output is correct
33 Correct 260 ms 31068 KB Output is correct
34 Correct 291 ms 29780 KB Output is correct
35 Correct 227 ms 31132 KB Output is correct
36 Correct 178 ms 30568 KB Output is correct
37 Correct 240 ms 31416 KB Output is correct
38 Correct 161 ms 28568 KB Output is correct
39 Correct 265 ms 30992 KB Output is correct
40 Correct 253 ms 28940 KB Output is correct
41 Correct 209 ms 30788 KB Output is correct
42 Correct 180 ms 30548 KB Output is correct
43 Correct 1 ms 204 KB Output is correct
44 Correct 115 ms 37960 KB Output is correct
45 Correct 105 ms 42172 KB Output is correct
46 Correct 3 ms 844 KB Output is correct
47 Correct 7 ms 844 KB Output is correct
48 Correct 3 ms 844 KB Output is correct
49 Correct 4 ms 844 KB Output is correct
50 Correct 3 ms 844 KB Output is correct
51 Correct 149 ms 28112 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 3 ms 844 KB Output is correct
3 Correct 4 ms 844 KB Output is correct
4 Correct 3 ms 844 KB Output is correct
5 Correct 1 ms 332 KB Output is correct
6 Correct 1 ms 332 KB Output is correct
7 Correct 1 ms 332 KB Output is correct
8 Correct 3 ms 716 KB Output is correct
9 Correct 3 ms 844 KB Output is correct
10 Correct 1 ms 332 KB Output is correct
11 Correct 1 ms 332 KB Output is correct
12 Correct 104 ms 18500 KB Output is correct
13 Correct 188 ms 30712 KB Output is correct
14 Correct 171 ms 27464 KB Output is correct
15 Correct 192 ms 30376 KB Output is correct
16 Correct 206 ms 30784 KB Output is correct
17 Correct 186 ms 30764 KB Output is correct
18 Correct 1 ms 204 KB Output is correct
19 Correct 160 ms 27952 KB Output is correct
20 Correct 1 ms 204 KB Output is correct
21 Correct 93 ms 35080 KB Output is correct
22 Correct 129 ms 39492 KB Output is correct
23 Correct 120 ms 42156 KB Output is correct
24 Correct 113 ms 42172 KB Output is correct
25 Correct 3 ms 972 KB Output is correct
26 Correct 3 ms 1076 KB Output is correct
27 Correct 3 ms 972 KB Output is correct
28 Correct 1 ms 332 KB Output is correct
29 Correct 1 ms 332 KB Output is correct
30 Correct 1 ms 332 KB Output is correct
31 Correct 62 ms 25452 KB Output is correct
32 Correct 107 ms 42180 KB Output is correct
33 Correct 1 ms 204 KB Output is correct
34 Correct 94 ms 37952 KB Output is correct
35 Correct 107 ms 42176 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 332 KB Output is correct
40 Correct 1 ms 332 KB Output is correct
41 Correct 1 ms 332 KB Output is correct
42 Correct 1 ms 332 KB Output is correct
43 Correct 1 ms 332 KB Output is correct
44 Correct 1 ms 332 KB Output is correct
45 Correct 1 ms 332 KB Output is correct
46 Correct 1 ms 332 KB Output is correct
47 Correct 1 ms 332 KB Output is correct
48 Correct 1 ms 332 KB Output is correct
49 Correct 1 ms 228 KB Output is correct
50 Correct 1 ms 332 KB Output is correct
51 Correct 1 ms 204 KB Output is correct
52 Correct 1 ms 332 KB Output is correct
53 Correct 1 ms 332 KB Output is correct
54 Correct 1 ms 332 KB Output is correct
55 Correct 1 ms 332 KB Output is correct
56 Correct 1 ms 204 KB Output is correct
57 Correct 1 ms 204 KB Output is correct
58 Correct 3 ms 588 KB Output is correct
59 Correct 4 ms 844 KB Output is correct
60 Correct 3 ms 844 KB Output is correct
61 Correct 3 ms 844 KB Output is correct
62 Correct 3 ms 844 KB Output is correct
63 Correct 3 ms 844 KB Output is correct
64 Correct 3 ms 844 KB Output is correct
65 Correct 3 ms 844 KB Output is correct
66 Correct 3 ms 844 KB Output is correct
67 Correct 3 ms 912 KB Output is correct
68 Correct 3 ms 972 KB Output is correct
69 Correct 4 ms 1100 KB Output is correct
70 Correct 3 ms 972 KB Output is correct
71 Correct 3 ms 844 KB Output is correct
72 Correct 3 ms 844 KB Output is correct
73 Correct 3 ms 844 KB Output is correct
74 Correct 1 ms 204 KB Output is correct
75 Correct 3 ms 204 KB Output is correct
76 Correct 1 ms 332 KB Output is correct
77 Correct 1 ms 332 KB Output is correct
78 Correct 1 ms 332 KB Output is correct
79 Correct 1 ms 332 KB Output is correct
80 Correct 2 ms 384 KB Output is correct
81 Correct 1 ms 332 KB Output is correct
82 Correct 1 ms 332 KB Output is correct
83 Correct 1 ms 332 KB Output is correct
84 Correct 1 ms 332 KB Output is correct
85 Correct 2 ms 204 KB Output is correct
86 Correct 2 ms 332 KB Output is correct
87 Correct 1 ms 332 KB Output is correct
88 Correct 4 ms 716 KB Output is correct
89 Correct 5 ms 844 KB Output is correct
90 Correct 3 ms 844 KB Output is correct
91 Correct 3 ms 716 KB Output is correct
92 Correct 5 ms 844 KB Output is correct
93 Correct 1 ms 204 KB Output is correct
94 Correct 1 ms 332 KB Output is correct
95 Correct 1 ms 332 KB Output is correct
96 Correct 2 ms 332 KB Output is correct
97 Correct 2 ms 332 KB Output is correct
98 Correct 1 ms 204 KB Output is correct
99 Correct 3 ms 844 KB Output is correct
100 Correct 3 ms 844 KB Output is correct
101 Correct 5 ms 844 KB Output is correct
102 Correct 5 ms 844 KB Output is correct
103 Correct 3 ms 844 KB Output is correct
104 Correct 248 ms 28840 KB Output is correct
105 Correct 267 ms 28300 KB Output is correct
106 Correct 194 ms 31068 KB Output is correct
107 Correct 243 ms 29764 KB Output is correct
108 Correct 211 ms 31032 KB Output is correct
109 Correct 195 ms 30532 KB Output is correct
110 Correct 238 ms 31344 KB Output is correct
111 Correct 151 ms 28484 KB Output is correct
112 Correct 260 ms 31036 KB Output is correct
113 Correct 251 ms 28944 KB Output is correct
114 Correct 205 ms 30788 KB Output is correct
115 Correct 213 ms 30548 KB Output is correct
116 Correct 2 ms 204 KB Output is correct
117 Correct 93 ms 37944 KB Output is correct
118 Correct 126 ms 42160 KB Output is correct
119 Correct 3 ms 844 KB Output is correct
120 Correct 3 ms 844 KB Output is correct
121 Correct 3 ms 844 KB Output is correct
122 Correct 3 ms 844 KB Output is correct
123 Correct 3 ms 844 KB Output is correct
124 Correct 166 ms 27928 KB Output is correct
125 Correct 1 ms 204 KB Output is correct
126 Correct 267 ms 29440 KB Output is correct
127 Correct 210 ms 23096 KB Output is correct
128 Correct 244 ms 31160 KB Output is correct
129 Correct 214 ms 29188 KB Output is correct
130 Correct 221 ms 30988 KB Output is correct
131 Correct 221 ms 30660 KB Output is correct
132 Correct 290 ms 31324 KB Output is correct
133 Correct 219 ms 29124 KB Output is correct
134 Correct 190 ms 29492 KB Output is correct
135 Correct 190 ms 28356 KB Output is correct
136 Correct 197 ms 30504 KB Output is correct
137 Correct 255 ms 28496 KB Output is correct
138 Correct 253 ms 27612 KB Output is correct
139 Correct 221 ms 30784 KB Output is correct
140 Correct 224 ms 30760 KB Output is correct
141 Correct 201 ms 30764 KB Output is correct
142 Correct 197 ms 30512 KB Output is correct
143 Correct 210 ms 30836 KB Output is correct
144 Correct 116 ms 35200 KB Output is correct
145 Correct 102 ms 39600 KB Output is correct
146 Correct 109 ms 42172 KB Output is correct
147 Correct 108 ms 42276 KB Output is correct
148 Correct 3 ms 588 KB Output is correct
149 Correct 4 ms 844 KB Output is correct
150 Correct 3 ms 844 KB Output is correct
151 Correct 3 ms 844 KB Output is correct
152 Correct 4 ms 844 KB Output is correct
153 Correct 3 ms 844 KB Output is correct
154 Correct 3 ms 844 KB Output is correct
155 Correct 3 ms 844 KB Output is correct
156 Correct 3 ms 844 KB Output is correct
157 Correct 3 ms 844 KB Output is correct
158 Correct 3 ms 972 KB Output is correct
159 Correct 5 ms 1100 KB Output is correct
160 Correct 3 ms 972 KB Output is correct
161 Correct 3 ms 844 KB Output is correct
162 Correct 4 ms 844 KB Output is correct
163 Correct 3 ms 844 KB Output is correct
164 Correct 2 ms 204 KB Output is correct
165 Correct 1 ms 204 KB Output is correct
166 Correct 1 ms 332 KB Output is correct
167 Correct 1 ms 332 KB Output is correct
168 Correct 1 ms 332 KB Output is correct
169 Correct 1 ms 332 KB Output is correct
170 Correct 1 ms 332 KB Output is correct
171 Correct 1 ms 332 KB Output is correct
172 Correct 1 ms 332 KB Output is correct
173 Correct 1 ms 332 KB Output is correct
174 Correct 1 ms 332 KB Output is correct
175 Correct 1 ms 332 KB Output is correct
176 Correct 2 ms 332 KB Output is correct
177 Correct 1 ms 332 KB Output is correct
178 Correct 184 ms 25620 KB Output is correct
179 Correct 182 ms 23228 KB Output is correct
180 Correct 235 ms 29744 KB Output is correct
181 Correct 218 ms 30956 KB Output is correct
182 Correct 188 ms 28532 KB Output is correct
183 Correct 211 ms 29408 KB Output is correct
184 Correct 210 ms 30512 KB Output is correct
185 Correct 256 ms 27204 KB Output is correct
186 Correct 175 ms 29112 KB Output is correct
187 Correct 271 ms 31428 KB Output is correct
188 Correct 287 ms 33432 KB Output is correct
189 Correct 232 ms 30704 KB Output is correct
190 Correct 200 ms 30588 KB Output is correct
191 Correct 73 ms 25452 KB Output is correct
192 Correct 108 ms 42168 KB Output is correct
193 Correct 3 ms 716 KB Output is correct
194 Correct 3 ms 844 KB Output is correct
195 Correct 3 ms 844 KB Output is correct
196 Correct 2 ms 716 KB Output is correct
197 Correct 3 ms 844 KB Output is correct
198 Correct 1 ms 204 KB Output is correct
199 Correct 1 ms 332 KB Output is correct
200 Correct 1 ms 332 KB Output is correct
201 Correct 2 ms 332 KB Output is correct
202 Correct 1 ms 332 KB Output is correct
203 Correct 115 ms 18540 KB Output is correct
204 Correct 176 ms 30768 KB Output is correct
205 Correct 161 ms 27452 KB Output is correct
206 Correct 212 ms 30480 KB Output is correct
207 Correct 201 ms 30812 KB Output is correct
208 Correct 209 ms 30792 KB Output is correct
209 Correct 244 ms 28896 KB Output is correct
210 Correct 246 ms 28356 KB Output is correct
211 Correct 218 ms 31040 KB Output is correct
212 Correct 267 ms 29752 KB Output is correct
213 Correct 216 ms 31040 KB Output is correct
214 Correct 197 ms 30576 KB Output is correct
215 Correct 238 ms 31396 KB Output is correct
216 Correct 156 ms 28512 KB Output is correct
217 Correct 244 ms 31008 KB Output is correct
218 Correct 258 ms 28840 KB Output is correct
219 Correct 206 ms 30788 KB Output is correct
220 Correct 179 ms 30740 KB Output is correct
221 Correct 1 ms 204 KB Output is correct
222 Correct 111 ms 37932 KB Output is correct
223 Correct 128 ms 42292 KB Output is correct
224 Correct 4 ms 856 KB Output is correct
225 Correct 3 ms 856 KB Output is correct
226 Correct 3 ms 856 KB Output is correct
227 Correct 3 ms 844 KB Output is correct
228 Correct 3 ms 844 KB Output is correct
229 Correct 166 ms 28004 KB Output is correct