Submission #964145

# Submission time Handle Problem Language Result Execution time Memory
964145 2024-04-16T11:13:02 Z happybelly Closing Time (IOI23_closing) C++17
100 / 100
338 ms 69692 KB
#include "closing.h"

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

struct Fenwick {
  vector<long long> a;

  int size;
  int lg;

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

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

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

  int lower_bound(long long v) {
    int idx = 0;
    long long 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<long long> pval, qval;
vector<vector<tuple<int, int>>> gr;
vector<bool> pxy;

int N;
long long K;

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

int GetScoreWithoutCommon() {
  vector<long long> pq;
  pq.insert(pq.end(), pval.begin(), pval.end());
  pq.insert(pq.end(), qval.begin(), qval.end());
  sort(pq.begin(), pq.end());
  long long total = 0;
  int ans = 0;
  for (long long c : pq) {
    if (total + c <= K) {
      total += c;
      ans++;
    }
  }
  return ans;
}

int GetScoreWithCommon() {
  vector<tuple<long long, 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 < static_cast<int>(elem.size()); i++) {
    int j = get<2>(elem[i]);
    if (get<1>(elem[i]) >= 0)
      pidx[j] = i;
    else
      qidx[j] = i;
  }

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

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

  auto GetOptimalLeftOver = [&](long long left) -> int {
    int idx = prefix.lower_bound(left + 1) - 1;
    long long 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]) <= left)
        return score;
    }

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

  long long total_xy = 0;
  int score_xy = 0, ans = 0;
  for (int i = 0; i < N; i++) {
    if (pxy[i]) {
      score_xy++;
      total_xy += pval[i];
      continue;
    }
    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]);
    if (pxy[node]) {
      total_xy += (qval[node] - pval[node]);
      score_xy++;
    } else {
      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 leftover = GetOptimalLeftOver(2 * (K - total_xy));
      ans = max(ans, score_xy + leftover);
    }
  }
  return ans;
}

int max_score(int _N, int X, int Y, long long _K, vector<int> U, vector<int> V,
              vector<int> W) {
  N = _N;
  K = _K;
  gr.assign(N, vector<tuple<int, int>>());
  pval.assign(N, 0);
  qval.assign(N, 0);
  pxy.assign(N, false);

  vector<int> parent(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, pval, parent);
  dfs(-1, Y, qval, parent);
  for (int i = 0; i < N; i++) {
    long long 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]) pxy[u] = true;
  return max(GetScoreWithoutCommon(), GetScoreWithCommon());
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 235 ms 62312 KB Output is correct
2 Correct 246 ms 69692 KB Output is correct
3 Correct 123 ms 5788 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 436 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 0 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 436 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 0 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 348 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 1 ms 344 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 1 ms 344 KB Output is correct
19 Correct 1 ms 624 KB Output is correct
20 Correct 1 ms 344 KB Output is correct
21 Correct 1 ms 604 KB Output is correct
22 Correct 1 ms 604 KB Output is correct
23 Correct 1 ms 604 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 436 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 0 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 348 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 1 ms 344 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 1 ms 344 KB Output is correct
19 Correct 1 ms 624 KB Output is correct
20 Correct 1 ms 344 KB Output is correct
21 Correct 1 ms 604 KB Output is correct
22 Correct 1 ms 604 KB Output is correct
23 Correct 1 ms 604 KB Output is correct
24 Correct 1 ms 604 KB Output is correct
25 Correct 3 ms 496 KB Output is correct
26 Correct 3 ms 1236 KB Output is correct
27 Correct 3 ms 1240 KB Output is correct
28 Correct 3 ms 1240 KB Output is correct
29 Correct 4 ms 1240 KB Output is correct
30 Correct 2 ms 1240 KB Output is correct
31 Correct 3 ms 1340 KB Output is correct
32 Correct 3 ms 1372 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 1 ms 348 KB Output is correct
5 Correct 0 ms 436 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 1 ms 440 KB Output is correct
8 Correct 0 ms 436 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 1 ms 344 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 1 ms 348 KB Output is correct
13 Correct 0 ms 344 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 1 ms 600 KB Output is correct
17 Correct 1 ms 344 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 1 ms 344 KB Output is correct
22 Correct 0 ms 348 KB Output is correct
23 Correct 0 ms 348 KB Output is correct
24 Correct 1 ms 428 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 1 ms 348 KB Output is correct
5 Correct 0 ms 436 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 1 ms 348 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 1 ms 344 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 1 ms 440 KB Output is correct
20 Correct 0 ms 436 KB Output is correct
21 Correct 0 ms 348 KB Output is correct
22 Correct 1 ms 344 KB Output is correct
23 Correct 0 ms 348 KB Output is correct
24 Correct 1 ms 348 KB Output is correct
25 Correct 0 ms 344 KB Output is correct
26 Correct 1 ms 348 KB Output is correct
27 Correct 0 ms 348 KB Output is correct
28 Correct 1 ms 600 KB Output is correct
29 Correct 1 ms 344 KB Output is correct
30 Correct 0 ms 348 KB Output is correct
31 Correct 0 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 0 ms 348 KB Output is correct
35 Correct 0 ms 348 KB Output is correct
36 Correct 1 ms 428 KB Output is correct
37 Correct 1 ms 348 KB Output is correct
38 Correct 0 ms 348 KB Output is correct
39 Correct 1 ms 348 KB Output is correct
40 Correct 1 ms 348 KB Output is correct
41 Correct 0 ms 444 KB Output is correct
42 Correct 1 ms 352 KB Output is correct
43 Correct 0 ms 348 KB Output is correct
44 Correct 1 ms 352 KB Output is correct
45 Correct 1 ms 500 KB Output is correct
46 Correct 1 ms 352 KB Output is correct
47 Correct 0 ms 352 KB Output is correct
48 Correct 1 ms 604 KB Output is correct
49 Correct 1 ms 352 KB Output is correct
50 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 0 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 0 ms 436 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 1 ms 348 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 1 ms 344 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 1 ms 344 KB Output is correct
20 Correct 1 ms 624 KB Output is correct
21 Correct 1 ms 344 KB Output is correct
22 Correct 1 ms 604 KB Output is correct
23 Correct 1 ms 604 KB Output is correct
24 Correct 1 ms 604 KB Output is correct
25 Correct 1 ms 604 KB Output is correct
26 Correct 1 ms 440 KB Output is correct
27 Correct 0 ms 436 KB Output is correct
28 Correct 0 ms 348 KB Output is correct
29 Correct 1 ms 344 KB Output is correct
30 Correct 0 ms 348 KB Output is correct
31 Correct 1 ms 348 KB Output is correct
32 Correct 0 ms 344 KB Output is correct
33 Correct 1 ms 348 KB Output is correct
34 Correct 0 ms 348 KB Output is correct
35 Correct 1 ms 600 KB Output is correct
36 Correct 1 ms 344 KB Output is correct
37 Correct 0 ms 348 KB Output is correct
38 Correct 0 ms 348 KB Output is correct
39 Correct 0 ms 348 KB Output is correct
40 Correct 1 ms 344 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 428 KB Output is correct
44 Correct 1 ms 348 KB Output is correct
45 Correct 0 ms 348 KB Output is correct
46 Correct 1 ms 348 KB Output is correct
47 Correct 1 ms 348 KB Output is correct
48 Correct 0 ms 444 KB Output is correct
49 Correct 1 ms 352 KB Output is correct
50 Correct 0 ms 348 KB Output is correct
51 Correct 1 ms 352 KB Output is correct
52 Correct 1 ms 500 KB Output is correct
53 Correct 1 ms 352 KB Output is correct
54 Correct 0 ms 352 KB Output is correct
55 Correct 1 ms 604 KB Output is correct
56 Correct 1 ms 352 KB Output is correct
57 Correct 1 ms 348 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 444 KB Output is correct
61 Correct 1 ms 352 KB Output is correct
62 Correct 1 ms 512 KB Output is correct
63 Correct 1 ms 348 KB Output is correct
64 Correct 1 ms 344 KB Output is correct
65 Correct 1 ms 348 KB Output is correct
66 Correct 1 ms 444 KB Output is correct
67 Correct 1 ms 348 KB Output is correct
68 Correct 1 ms 604 KB Output is correct
69 Correct 1 ms 604 KB Output is correct
70 Correct 1 ms 440 KB Output is correct
71 Correct 1 ms 344 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
# 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 1 ms 348 KB Output is correct
5 Correct 0 ms 436 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 1 ms 348 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 1 ms 344 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 1 ms 344 KB Output is correct
20 Correct 1 ms 624 KB Output is correct
21 Correct 1 ms 344 KB Output is correct
22 Correct 1 ms 604 KB Output is correct
23 Correct 1 ms 604 KB Output is correct
24 Correct 1 ms 604 KB Output is correct
25 Correct 1 ms 604 KB Output is correct
26 Correct 3 ms 496 KB Output is correct
27 Correct 3 ms 1236 KB Output is correct
28 Correct 3 ms 1240 KB Output is correct
29 Correct 3 ms 1240 KB Output is correct
30 Correct 4 ms 1240 KB Output is correct
31 Correct 2 ms 1240 KB Output is correct
32 Correct 3 ms 1340 KB Output is correct
33 Correct 3 ms 1372 KB Output is correct
34 Correct 1 ms 440 KB Output is correct
35 Correct 0 ms 436 KB Output is correct
36 Correct 0 ms 348 KB Output is correct
37 Correct 1 ms 344 KB Output is correct
38 Correct 0 ms 348 KB Output is correct
39 Correct 1 ms 348 KB Output is correct
40 Correct 0 ms 344 KB Output is correct
41 Correct 1 ms 348 KB Output is correct
42 Correct 0 ms 348 KB Output is correct
43 Correct 1 ms 600 KB Output is correct
44 Correct 1 ms 344 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 1 ms 344 KB Output is correct
49 Correct 0 ms 348 KB Output is correct
50 Correct 0 ms 348 KB Output is correct
51 Correct 1 ms 428 KB Output is correct
52 Correct 1 ms 348 KB Output is correct
53 Correct 0 ms 348 KB Output is correct
54 Correct 1 ms 348 KB Output is correct
55 Correct 1 ms 348 KB Output is correct
56 Correct 0 ms 444 KB Output is correct
57 Correct 1 ms 352 KB Output is correct
58 Correct 0 ms 348 KB Output is correct
59 Correct 1 ms 352 KB Output is correct
60 Correct 1 ms 500 KB Output is correct
61 Correct 1 ms 352 KB Output is correct
62 Correct 0 ms 352 KB Output is correct
63 Correct 1 ms 604 KB Output is correct
64 Correct 1 ms 352 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 444 KB Output is correct
69 Correct 1 ms 352 KB Output is correct
70 Correct 1 ms 512 KB Output is correct
71 Correct 1 ms 348 KB Output is correct
72 Correct 1 ms 344 KB Output is correct
73 Correct 1 ms 348 KB Output is correct
74 Correct 1 ms 444 KB Output is correct
75 Correct 1 ms 348 KB Output is correct
76 Correct 1 ms 604 KB Output is correct
77 Correct 1 ms 604 KB Output is correct
78 Correct 1 ms 440 KB Output is correct
79 Correct 1 ms 344 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 348 KB Output is correct
83 Correct 1 ms 348 KB Output is correct
84 Correct 2 ms 348 KB Output is correct
85 Correct 3 ms 348 KB Output is correct
86 Correct 2 ms 348 KB Output is correct
87 Correct 2 ms 548 KB Output is correct
88 Correct 3 ms 348 KB Output is correct
89 Correct 3 ms 1152 KB Output is correct
90 Correct 3 ms 1116 KB Output is correct
91 Correct 3 ms 1240 KB Output is correct
92 Correct 4 ms 1192 KB Output is correct
93 Correct 3 ms 1240 KB Output is correct
94 Correct 3 ms 1240 KB Output is correct
95 Correct 3 ms 1240 KB Output is correct
96 Correct 3 ms 1240 KB Output is correct
97 Correct 3 ms 1240 KB Output is correct
98 Correct 4 ms 1240 KB Output is correct
99 Correct 3 ms 1236 KB Output is correct
100 Correct 4 ms 860 KB Output is correct
101 Correct 3 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 0 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 0 ms 436 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 1 ms 348 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 1 ms 344 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 1 ms 344 KB Output is correct
20 Correct 1 ms 624 KB Output is correct
21 Correct 1 ms 344 KB Output is correct
22 Correct 1 ms 604 KB Output is correct
23 Correct 1 ms 604 KB Output is correct
24 Correct 1 ms 604 KB Output is correct
25 Correct 1 ms 604 KB Output is correct
26 Correct 3 ms 496 KB Output is correct
27 Correct 3 ms 1236 KB Output is correct
28 Correct 3 ms 1240 KB Output is correct
29 Correct 3 ms 1240 KB Output is correct
30 Correct 4 ms 1240 KB Output is correct
31 Correct 2 ms 1240 KB Output is correct
32 Correct 3 ms 1340 KB Output is correct
33 Correct 3 ms 1372 KB Output is correct
34 Correct 1 ms 440 KB Output is correct
35 Correct 0 ms 436 KB Output is correct
36 Correct 0 ms 348 KB Output is correct
37 Correct 1 ms 344 KB Output is correct
38 Correct 0 ms 348 KB Output is correct
39 Correct 1 ms 348 KB Output is correct
40 Correct 0 ms 344 KB Output is correct
41 Correct 1 ms 348 KB Output is correct
42 Correct 0 ms 348 KB Output is correct
43 Correct 1 ms 600 KB Output is correct
44 Correct 1 ms 344 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 1 ms 344 KB Output is correct
49 Correct 0 ms 348 KB Output is correct
50 Correct 0 ms 348 KB Output is correct
51 Correct 1 ms 428 KB Output is correct
52 Correct 1 ms 348 KB Output is correct
53 Correct 0 ms 348 KB Output is correct
54 Correct 1 ms 348 KB Output is correct
55 Correct 1 ms 348 KB Output is correct
56 Correct 0 ms 444 KB Output is correct
57 Correct 1 ms 352 KB Output is correct
58 Correct 0 ms 348 KB Output is correct
59 Correct 1 ms 352 KB Output is correct
60 Correct 1 ms 500 KB Output is correct
61 Correct 1 ms 352 KB Output is correct
62 Correct 0 ms 352 KB Output is correct
63 Correct 1 ms 604 KB Output is correct
64 Correct 1 ms 352 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 444 KB Output is correct
69 Correct 1 ms 352 KB Output is correct
70 Correct 1 ms 512 KB Output is correct
71 Correct 1 ms 348 KB Output is correct
72 Correct 1 ms 344 KB Output is correct
73 Correct 1 ms 348 KB Output is correct
74 Correct 1 ms 444 KB Output is correct
75 Correct 1 ms 348 KB Output is correct
76 Correct 1 ms 604 KB Output is correct
77 Correct 1 ms 604 KB Output is correct
78 Correct 1 ms 440 KB Output is correct
79 Correct 1 ms 344 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 348 KB Output is correct
83 Correct 1 ms 348 KB Output is correct
84 Correct 2 ms 348 KB Output is correct
85 Correct 3 ms 348 KB Output is correct
86 Correct 2 ms 348 KB Output is correct
87 Correct 2 ms 548 KB Output is correct
88 Correct 3 ms 348 KB Output is correct
89 Correct 3 ms 1152 KB Output is correct
90 Correct 3 ms 1116 KB Output is correct
91 Correct 3 ms 1240 KB Output is correct
92 Correct 4 ms 1192 KB Output is correct
93 Correct 3 ms 1240 KB Output is correct
94 Correct 3 ms 1240 KB Output is correct
95 Correct 3 ms 1240 KB Output is correct
96 Correct 3 ms 1240 KB Output is correct
97 Correct 3 ms 1240 KB Output is correct
98 Correct 4 ms 1240 KB Output is correct
99 Correct 3 ms 1236 KB Output is correct
100 Correct 4 ms 860 KB Output is correct
101 Correct 3 ms 604 KB Output is correct
102 Correct 126 ms 5568 KB Output is correct
103 Correct 149 ms 5748 KB Output is correct
104 Correct 273 ms 65676 KB Output is correct
105 Correct 184 ms 8172 KB Output is correct
106 Correct 181 ms 7420 KB Output is correct
107 Correct 142 ms 53608 KB Output is correct
108 Correct 154 ms 54788 KB Output is correct
109 Correct 145 ms 68708 KB Output is correct
110 Correct 319 ms 58772 KB Output is correct
111 Correct 200 ms 61976 KB Output is correct
112 Correct 297 ms 57952 KB Output is correct
113 Correct 250 ms 55868 KB Output is correct
114 Correct 244 ms 56980 KB Output is correct
115 Correct 206 ms 69092 KB Output is correct
116 Correct 338 ms 61412 KB Output is correct
117 Correct 270 ms 61556 KB Output is correct
118 Correct 276 ms 56244 KB Output is correct
119 Correct 190 ms 13088 KB Output is correct
120 Correct 117 ms 4944 KB Output is correct