Submission #965079

# Submission time Handle Problem Language Result Execution time Memory
965079 2024-04-18T05:12:50 Z happybelly Closing Time (IOI23_closing) C++17
100 / 100
298 ms 65312 KB
#include "closing.h"

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;

struct Fenwick {
  vector<ll> a;
  int size;
  int lg;

  Fenwick(int size_) {
    size = size_;
    a.resize(size + 1, 0);
    lg = 0;
    while ((1 << lg) <= size) lg++;
  }

  void add(int i, ll v) {
    for (; i <= size; i += i & -i) a[i] += v;
  }

  ll query(int i) {
    ll ans = 0;
    for (; i > 0; i -= i & -i) ans += a[i];
    return ans;
  }

  int lower_bound(ll v) {
    int idx = 0;
    ll sum = 0;
    for (int i = lg - 1; i >= 0; i--)
      if (idx + (1 << i) <= size && sum + a[idx + (1 << i)] < v) {
        idx += (1 << i);
        sum += a[idx];
      }
    return idx + 1;
  }
};

vector<ll> pval, qval;
vector<vector<tuple<int, int>>> gr;
vector<bool> inxy;
vector<int> parent;

int N;
ll K;

void dfs(int p, int u, ll d, vector<ll> &dist) {
  parent[u] = p;
  dist[u] = d;
  for (auto &t : gr[u]) {
    int v = get<0>(t);
    if (v != p) dfs(u, v, d + get<1>(t), dist);
  }
}

int GetScoreWithoutCommon() {
  vector<ll> pq;
  pq.insert(pq.end(), pval.begin(), pval.end());
  pq.insert(pq.end(), qval.begin(), qval.end());
  sort(pq.begin(), pq.end());

  ll total = 0;
  int ans = 0;
  for (auto &c : pq) {
    if (total + c <= K) {
      total += c;
      ans++;
    } else
      break;
  }
  return ans;
}

int GetScoreWithCommon() {
  ll total_xy = 0;
  int ans = 0;
  for (int i = 0; i < N; i++)
    if (inxy[i]) {
      total_xy += pval[i];
      qval[i] -= pval[i];
      pval[i] = 0;
    }

  vector<tuple<ll, ll, int>> diffs;
  for (int i = 0; i < N; i++) diffs.emplace_back(qval[i] - pval[i], pval[i], i);
  sort(diffs.begin(), diffs.end());

  vector<tuple<ll, int, int>> elem;
  for (int i = 0; i < N; i++) {
    elem.emplace_back(2 * pval[i], i, i);
    elem.emplace_back(qval[i], -2 * i - 1, i);
    elem.emplace_back(qval[i], -2 * i - 2, i);
  }
  elem.emplace_back(-1, 0, 0);
  sort(elem.begin(), elem.end());

  vector<int> pidx(N), qidx(N);
  for (int i = 1; i <= 3 * N; i++) {
    int j = get<2>(elem[i]);
    if (get<1>(elem[i]) >= 0)
      pidx[j] = i;
    else
      qidx[j] = i;
  }

  Fenwick prefix(3 * N), p_ctr(3 * N), q_ctr(3 * N);

  auto Knapsack01 = [&](ll cap) -> int {
    int idx = prefix.lower_bound(cap + 1) - 1;
    ll total = prefix.query(idx);
    int score = p_ctr.query(idx) + q_ctr.query(idx);

    if (q_ctr.query(idx) % 2 == 0) return score;

    int curr_p = p_ctr.lower_bound(p_ctr.query(idx)),
        curr_q = q_ctr.lower_bound(q_ctr.query(idx));
    if (p_ctr.query(idx) != p_ctr.query(3 * N)) {
      int next_p = p_ctr.lower_bound(p_ctr.query(idx) + 1);
      if (total - get<0>(elem[curr_q]) + get<0>(elem[next_p]) <= cap)
        return score;
    }

    if (curr_p > 0) {
      if (total - get<0>(elem[curr_p]) + get<0>(elem[curr_q]) <= cap)
        return score;
    }
    return score - 1;
  };

  for (int i = 0; i < N; i++) {
    int idx = pidx[i];
    prefix.add(idx, 2 * pval[i]);
    p_ctr.add(idx, 1);
  }

  for (int i = 0; i < N; i++) {
    int node = get<2>(diffs[i]);
    int idx = pidx[node];
    prefix.add(idx, -2 * pval[node]);
    p_ctr.add(idx, -1);

    idx = qidx[node];
    prefix.add(idx, qval[node]);
    prefix.add(idx - 1, qval[node]);
    q_ctr.add(idx, 1);
    q_ctr.add(idx - 1, 1);
    if (total_xy <= K) {
      int score = Knapsack01(2 * (K - total_xy));
      ans = max(ans, score);
    }
  }
  return ans;
}

int max_score(int N_, int X, int Y, ll K_, vector<int> U, vector<int> V,
              vector<int> W) {
  N = N_;
  K = K_;
  gr.assign(N, vector<tuple<int, int>>());
  pval.resize(N);
  qval.resize(N);
  inxy.assign(N, false);
  parent.resize(N);

  for (int i = 0; i < static_cast<int>(U.size()); i++) {
    gr[U[i]].emplace_back(V[i], W[i]);
    gr[V[i]].emplace_back(U[i], W[i]);
  }
  dfs(-1, X, 0, pval);
  dfs(-1, Y, 0, qval);
  for (int i = 0; i < N; i++) {
    auto t = min(pval[i], qval[i]);
    qval[i] = max(pval[i], qval[i]);
    pval[i] = t;
  }

  for (int u = X; u != -1; u = parent[u]) inxy[u] = true;
  return max(GetScoreWithCommon(), GetScoreWithoutCommon());
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 235 ms 59388 KB Output is correct
2 Correct 266 ms 64612 KB Output is correct
3 Correct 130 ms 5732 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 1 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 1 ms 544 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 1 ms 344 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 1 ms 348 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 1 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 1 ms 544 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 1 ms 344 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 1 ms 348 KB Output is correct
13 Correct 1 ms 344 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 0 ms 432 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 1 ms 348 KB Output is correct
20 Correct 1 ms 348 KB Output is correct
21 Correct 1 ms 344 KB Output is correct
22 Correct 1 ms 600 KB Output is correct
23 Correct 1 ms 348 KB Output is correct
24 Correct 1 ms 604 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 1 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 1 ms 544 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 1 ms 344 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 1 ms 348 KB Output is correct
13 Correct 1 ms 344 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 0 ms 432 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 1 ms 348 KB Output is correct
20 Correct 1 ms 348 KB Output is correct
21 Correct 1 ms 344 KB Output is correct
22 Correct 1 ms 600 KB Output is correct
23 Correct 1 ms 348 KB Output is correct
24 Correct 1 ms 604 KB Output is correct
25 Correct 2 ms 524 KB Output is correct
26 Correct 3 ms 1624 KB Output is correct
27 Correct 3 ms 1240 KB Output is correct
28 Correct 3 ms 1368 KB Output is correct
29 Correct 4 ms 1372 KB Output is correct
30 Correct 3 ms 1372 KB Output is correct
31 Correct 3 ms 1372 KB Output is correct
32 Correct 3 ms 1372 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 428 KB Output is correct
8 Correct 1 ms 436 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 1 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 1 ms 344 KB Output is correct
15 Correct 1 ms 344 KB Output is correct
16 Correct 1 ms 348 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 1 ms 344 KB Output is correct
21 Correct 0 ms 344 KB Output is correct
22 Correct 1 ms 348 KB Output is correct
23 Correct 1 ms 348 KB Output is correct
24 Correct 1 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 1 ms 544 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 1 ms 344 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 1 ms 348 KB Output is correct
13 Correct 1 ms 348 KB Output is correct
14 Correct 1 ms 344 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 0 ms 432 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 0 ms 428 KB Output is correct
20 Correct 1 ms 436 KB Output is correct
21 Correct 0 ms 348 KB Output is correct
22 Correct 1 ms 348 KB Output is correct
23 Correct 1 ms 348 KB Output is correct
24 Correct 1 ms 348 KB Output is correct
25 Correct 0 ms 348 KB Output is correct
26 Correct 1 ms 344 KB Output is correct
27 Correct 1 ms 344 KB Output is correct
28 Correct 1 ms 348 KB Output is correct
29 Correct 1 ms 348 KB Output is correct
30 Correct 0 ms 348 KB Output is correct
31 Correct 0 ms 348 KB Output is correct
32 Correct 1 ms 344 KB Output is correct
33 Correct 0 ms 344 KB Output is correct
34 Correct 1 ms 348 KB Output is correct
35 Correct 1 ms 348 KB Output is correct
36 Correct 1 ms 348 KB Output is correct
37 Correct 1 ms 344 KB Output is correct
38 Correct 1 ms 344 KB Output is correct
39 Correct 1 ms 348 KB Output is correct
40 Correct 1 ms 432 KB Output is correct
41 Correct 1 ms 348 KB Output is correct
42 Correct 1 ms 344 KB Output is correct
43 Correct 1 ms 348 KB Output is correct
44 Correct 1 ms 348 KB Output is correct
45 Correct 1 ms 344 KB Output is correct
46 Correct 1 ms 548 KB Output is correct
47 Correct 1 ms 344 KB Output is correct
48 Correct 1 ms 348 KB Output is correct
49 Correct 1 ms 348 KB Output is correct
50 Correct 1 ms 344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 1 ms 544 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 1 ms 344 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 1 ms 348 KB Output is correct
13 Correct 1 ms 348 KB Output is correct
14 Correct 1 ms 344 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 0 ms 432 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 1 ms 348 KB Output is correct
20 Correct 1 ms 348 KB Output is correct
21 Correct 1 ms 348 KB Output is correct
22 Correct 1 ms 344 KB Output is correct
23 Correct 1 ms 600 KB Output is correct
24 Correct 1 ms 348 KB Output is correct
25 Correct 1 ms 604 KB Output is correct
26 Correct 0 ms 428 KB Output is correct
27 Correct 1 ms 436 KB Output is correct
28 Correct 0 ms 348 KB Output is correct
29 Correct 1 ms 348 KB Output is correct
30 Correct 1 ms 348 KB Output is correct
31 Correct 1 ms 348 KB Output is correct
32 Correct 0 ms 348 KB Output is correct
33 Correct 1 ms 344 KB Output is correct
34 Correct 1 ms 344 KB Output is correct
35 Correct 1 ms 348 KB Output is correct
36 Correct 1 ms 348 KB Output is correct
37 Correct 0 ms 348 KB Output is correct
38 Correct 0 ms 348 KB Output is correct
39 Correct 1 ms 344 KB Output is correct
40 Correct 0 ms 344 KB Output is correct
41 Correct 1 ms 348 KB Output is correct
42 Correct 1 ms 348 KB Output is correct
43 Correct 1 ms 348 KB Output is correct
44 Correct 1 ms 344 KB Output is correct
45 Correct 1 ms 344 KB Output is correct
46 Correct 1 ms 348 KB Output is correct
47 Correct 1 ms 432 KB Output is correct
48 Correct 1 ms 348 KB Output is correct
49 Correct 1 ms 344 KB Output is correct
50 Correct 1 ms 348 KB Output is correct
51 Correct 1 ms 348 KB Output is correct
52 Correct 1 ms 344 KB Output is correct
53 Correct 1 ms 548 KB Output is correct
54 Correct 1 ms 344 KB Output is correct
55 Correct 1 ms 348 KB Output is correct
56 Correct 1 ms 348 KB Output is correct
57 Correct 1 ms 344 KB Output is correct
58 Correct 1 ms 348 KB Output is correct
59 Correct 1 ms 348 KB Output is correct
60 Correct 1 ms 348 KB Output is correct
61 Correct 1 ms 348 KB Output is correct
62 Correct 2 ms 348 KB Output is correct
63 Correct 1 ms 348 KB Output is correct
64 Correct 1 ms 348 KB Output is correct
65 Correct 1 ms 348 KB Output is correct
66 Correct 1 ms 348 KB Output is correct
67 Correct 1 ms 348 KB Output is correct
68 Correct 1 ms 504 KB Output is correct
69 Correct 1 ms 520 KB Output is correct
70 Correct 1 ms 348 KB Output is correct
71 Correct 1 ms 348 KB Output is correct
72 Correct 1 ms 348 KB Output is correct
73 Correct 1 ms 348 KB Output is correct
74 Correct 1 ms 604 KB Output is correct
75 Correct 1 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 1 ms 544 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 1 ms 344 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 1 ms 348 KB Output is correct
13 Correct 1 ms 348 KB Output is correct
14 Correct 1 ms 344 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 0 ms 432 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 1 ms 348 KB Output is correct
20 Correct 1 ms 348 KB Output is correct
21 Correct 1 ms 348 KB Output is correct
22 Correct 1 ms 344 KB Output is correct
23 Correct 1 ms 600 KB Output is correct
24 Correct 1 ms 348 KB Output is correct
25 Correct 1 ms 604 KB Output is correct
26 Correct 2 ms 524 KB Output is correct
27 Correct 3 ms 1624 KB Output is correct
28 Correct 3 ms 1240 KB Output is correct
29 Correct 3 ms 1368 KB Output is correct
30 Correct 4 ms 1372 KB Output is correct
31 Correct 3 ms 1372 KB Output is correct
32 Correct 3 ms 1372 KB Output is correct
33 Correct 3 ms 1372 KB Output is correct
34 Correct 0 ms 428 KB Output is correct
35 Correct 1 ms 436 KB Output is correct
36 Correct 0 ms 348 KB Output is correct
37 Correct 1 ms 348 KB Output is correct
38 Correct 1 ms 348 KB Output is correct
39 Correct 1 ms 348 KB Output is correct
40 Correct 0 ms 348 KB Output is correct
41 Correct 1 ms 344 KB Output is correct
42 Correct 1 ms 344 KB Output is correct
43 Correct 1 ms 348 KB Output is correct
44 Correct 1 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 1 ms 344 KB Output is correct
48 Correct 0 ms 344 KB Output is correct
49 Correct 1 ms 348 KB Output is correct
50 Correct 1 ms 348 KB Output is correct
51 Correct 1 ms 348 KB Output is correct
52 Correct 1 ms 344 KB Output is correct
53 Correct 1 ms 344 KB Output is correct
54 Correct 1 ms 348 KB Output is correct
55 Correct 1 ms 432 KB Output is correct
56 Correct 1 ms 348 KB Output is correct
57 Correct 1 ms 344 KB Output is correct
58 Correct 1 ms 348 KB Output is correct
59 Correct 1 ms 348 KB Output is correct
60 Correct 1 ms 344 KB Output is correct
61 Correct 1 ms 548 KB Output is correct
62 Correct 1 ms 344 KB Output is correct
63 Correct 1 ms 348 KB Output is correct
64 Correct 1 ms 348 KB Output is correct
65 Correct 1 ms 344 KB Output is correct
66 Correct 1 ms 348 KB Output is correct
67 Correct 1 ms 348 KB Output is correct
68 Correct 1 ms 348 KB Output is correct
69 Correct 1 ms 348 KB Output is correct
70 Correct 2 ms 348 KB Output is correct
71 Correct 1 ms 348 KB Output is correct
72 Correct 1 ms 348 KB Output is correct
73 Correct 1 ms 348 KB Output is correct
74 Correct 1 ms 348 KB Output is correct
75 Correct 1 ms 348 KB Output is correct
76 Correct 1 ms 504 KB Output is correct
77 Correct 1 ms 520 KB Output is correct
78 Correct 1 ms 348 KB Output is correct
79 Correct 1 ms 348 KB Output is correct
80 Correct 1 ms 348 KB Output is correct
81 Correct 1 ms 348 KB Output is correct
82 Correct 1 ms 604 KB Output is correct
83 Correct 1 ms 348 KB Output is correct
84 Correct 3 ms 344 KB Output is correct
85 Correct 3 ms 604 KB Output is correct
86 Correct 2 ms 348 KB Output is correct
87 Correct 2 ms 344 KB Output is correct
88 Correct 2 ms 492 KB Output is correct
89 Correct 3 ms 1240 KB Output is correct
90 Correct 3 ms 1116 KB Output is correct
91 Correct 3 ms 1236 KB Output is correct
92 Correct 3 ms 1116 KB Output is correct
93 Correct 3 ms 1116 KB Output is correct
94 Correct 3 ms 1372 KB Output is correct
95 Correct 3 ms 1372 KB Output is correct
96 Correct 3 ms 1240 KB Output is correct
97 Correct 4 ms 1236 KB Output is correct
98 Correct 3 ms 1112 KB Output is correct
99 Correct 5 ms 1240 KB Output is correct
100 Correct 3 ms 1004 KB Output is correct
101 Correct 3 ms 604 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 1 ms 544 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 1 ms 344 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 1 ms 348 KB Output is correct
13 Correct 1 ms 348 KB Output is correct
14 Correct 1 ms 344 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 0 ms 432 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 1 ms 348 KB Output is correct
20 Correct 1 ms 348 KB Output is correct
21 Correct 1 ms 348 KB Output is correct
22 Correct 1 ms 344 KB Output is correct
23 Correct 1 ms 600 KB Output is correct
24 Correct 1 ms 348 KB Output is correct
25 Correct 1 ms 604 KB Output is correct
26 Correct 2 ms 524 KB Output is correct
27 Correct 3 ms 1624 KB Output is correct
28 Correct 3 ms 1240 KB Output is correct
29 Correct 3 ms 1368 KB Output is correct
30 Correct 4 ms 1372 KB Output is correct
31 Correct 3 ms 1372 KB Output is correct
32 Correct 3 ms 1372 KB Output is correct
33 Correct 3 ms 1372 KB Output is correct
34 Correct 0 ms 428 KB Output is correct
35 Correct 1 ms 436 KB Output is correct
36 Correct 0 ms 348 KB Output is correct
37 Correct 1 ms 348 KB Output is correct
38 Correct 1 ms 348 KB Output is correct
39 Correct 1 ms 348 KB Output is correct
40 Correct 0 ms 348 KB Output is correct
41 Correct 1 ms 344 KB Output is correct
42 Correct 1 ms 344 KB Output is correct
43 Correct 1 ms 348 KB Output is correct
44 Correct 1 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 1 ms 344 KB Output is correct
48 Correct 0 ms 344 KB Output is correct
49 Correct 1 ms 348 KB Output is correct
50 Correct 1 ms 348 KB Output is correct
51 Correct 1 ms 348 KB Output is correct
52 Correct 1 ms 344 KB Output is correct
53 Correct 1 ms 344 KB Output is correct
54 Correct 1 ms 348 KB Output is correct
55 Correct 1 ms 432 KB Output is correct
56 Correct 1 ms 348 KB Output is correct
57 Correct 1 ms 344 KB Output is correct
58 Correct 1 ms 348 KB Output is correct
59 Correct 1 ms 348 KB Output is correct
60 Correct 1 ms 344 KB Output is correct
61 Correct 1 ms 548 KB Output is correct
62 Correct 1 ms 344 KB Output is correct
63 Correct 1 ms 348 KB Output is correct
64 Correct 1 ms 348 KB Output is correct
65 Correct 1 ms 344 KB Output is correct
66 Correct 1 ms 348 KB Output is correct
67 Correct 1 ms 348 KB Output is correct
68 Correct 1 ms 348 KB Output is correct
69 Correct 1 ms 348 KB Output is correct
70 Correct 2 ms 348 KB Output is correct
71 Correct 1 ms 348 KB Output is correct
72 Correct 1 ms 348 KB Output is correct
73 Correct 1 ms 348 KB Output is correct
74 Correct 1 ms 348 KB Output is correct
75 Correct 1 ms 348 KB Output is correct
76 Correct 1 ms 504 KB Output is correct
77 Correct 1 ms 520 KB Output is correct
78 Correct 1 ms 348 KB Output is correct
79 Correct 1 ms 348 KB Output is correct
80 Correct 1 ms 348 KB Output is correct
81 Correct 1 ms 348 KB Output is correct
82 Correct 1 ms 604 KB Output is correct
83 Correct 1 ms 348 KB Output is correct
84 Correct 3 ms 344 KB Output is correct
85 Correct 3 ms 604 KB Output is correct
86 Correct 2 ms 348 KB Output is correct
87 Correct 2 ms 344 KB Output is correct
88 Correct 2 ms 492 KB Output is correct
89 Correct 3 ms 1240 KB Output is correct
90 Correct 3 ms 1116 KB Output is correct
91 Correct 3 ms 1236 KB Output is correct
92 Correct 3 ms 1116 KB Output is correct
93 Correct 3 ms 1116 KB Output is correct
94 Correct 3 ms 1372 KB Output is correct
95 Correct 3 ms 1372 KB Output is correct
96 Correct 3 ms 1240 KB Output is correct
97 Correct 4 ms 1236 KB Output is correct
98 Correct 3 ms 1112 KB Output is correct
99 Correct 5 ms 1240 KB Output is correct
100 Correct 3 ms 1004 KB Output is correct
101 Correct 3 ms 604 KB Output is correct
102 Correct 123 ms 5456 KB Output is correct
103 Correct 136 ms 5756 KB Output is correct
104 Correct 272 ms 62300 KB Output is correct
105 Correct 188 ms 8428 KB Output is correct
106 Correct 189 ms 7896 KB Output is correct
107 Correct 136 ms 50424 KB Output is correct
108 Correct 151 ms 53908 KB Output is correct
109 Correct 155 ms 62452 KB Output is correct
110 Correct 289 ms 56432 KB Output is correct
111 Correct 181 ms 58136 KB Output is correct
112 Correct 279 ms 55204 KB Output is correct
113 Correct 264 ms 53724 KB Output is correct
114 Correct 251 ms 55136 KB Output is correct
115 Correct 201 ms 65312 KB Output is correct
116 Correct 298 ms 55804 KB Output is correct
117 Correct 266 ms 59500 KB Output is correct
118 Correct 282 ms 56804 KB Output is correct
119 Correct 186 ms 13424 KB Output is correct
120 Correct 130 ms 5176 KB Output is correct