Submission #630193

# Submission time Handle Problem Language Result Execution time Memory
630193 2022-08-15T23:26:56 Z abeker Radio Towers (IOI22_towers) C++17
73 / 100
4000 ms 60240 KB
#include <bits/stdc++.h>
#include "towers.h"
using namespace std;

const int INF = INT_MAX;

class RMQ {
  int offset;
  vector <int> tour;
public:
  RMQ(vector <int> vals) {
    for (offset = 1; offset < vals.size(); offset *= 2);
    tour.resize(2 * offset);
    for (int i = 0; i < offset; i++)
      tour[i + offset] = i < vals.size() ? vals[i] : INF;
    for (int i = offset - 1; i; i--)
      tour[i] = min(tour[2 * i], tour[2 * i + 1]);
  }
  RMQ() {}
  int query(int x, int lo, int hi, int from, int to) const {
    if (lo >= to || hi <= from)
      return INF;
    if (lo >= from && hi <= to)
      return tour[x];
    int mid = (lo + hi) / 2;
    return min(query(2 * x, lo, mid, from, to), query(2 * x + 1, mid, hi, from, to));
  }
  int query(int from, int to) const {
    return query(1, 0, offset, from, to);
  }
};

class Orthogonal {
  int offset;
  vector <vector <int>> tour;
public:
  Orthogonal(vector <int> vals) {
    for (offset = 1; offset < vals.size(); offset *= 2);
    tour.resize(2 * offset);
    for (int i = 1; i < vals.size(); i++)
      tour[i + offset].push_back(vals[i]);
    for (int i = offset - 1; i; i--) {
      tour[i].resize(tour[2 * i].size() + tour[2 * i + 1].size());
      merge(tour[2 * i].begin(), tour[2 * i].end(), tour[2 * i + 1].begin(), tour[2 * i + 1].end(), tour[i].begin());
    }
  }
  Orthogonal() {}
  int query(int x, int lo, int hi, int from, int to, int val) {
    if (lo >= to || hi <= from)
      return 0;
    if (lo >= from && hi <= to)
      return lower_bound(tour[x].begin(), tour[x].end(), val) - tour[x].begin();
    int mid = (lo + hi) / 2;
    return query(2 * x, lo, mid, from, to, val) + query(2 * x + 1, mid, hi, from, to, val);
  }
  int query(int from, int to, int val) {
    return query(1, 0, offset, from, to, val);
  }
};

int N, lg;
vector <int> H;
vector <int> lb, ub;
vector <vector <int>> lft, rig;
Orthogonal count_lb, count_ub;
RMQ mini;

void init(int n, vector <int> h) {
  N = n;
  H.resize(N + 2);
  H[0] = H[N + 1] = INF;
  for (int i = 1; i <= N; i++)
    H[i] = h[i - 1];
  while (1 << lg < N)
    lg++;
  lft.resize(N + 2, vector <int> (lg + 1));
  rig.resize(N + 2, vector <int> (lg + 1));
  stack <int> s;
  s.push(0);
  for (int i = 1; i <= N; i++) {
    while (H[s.top()] < H[i])
      s.pop();
    lft[i][0] = s.top();
    s.push(i);
  }
  s = stack <int> ();
  s.push(N + 1);
  for (int i = N; i; i--) {
    while (H[s.top()] < H[i])
      s.pop();
    rig[i][0] = s.top();
    s.push(i);
  }
  rig[N + 1] = vector <int> (lg + 1, N + 1);
  for (int j = 1; j <= lg; j++)
    for (int i = 1; i <= N; i++) {
      lft[i][j] = lft[lft[i][j - 1]][j - 1];
      rig[i][j] = rig[rig[i][j - 1]][j - 1];
    }
  mini = RMQ(H);
  lb.resize(N + 1);
  ub.resize(N + 1);
  for (int i = 1; i <= N; i++) {
    int tmp = mini.query(lft[i][0] + 1, rig[i][0]);
    lb[i] = H[i] - tmp;
    ub[i] = min(H[lft[i][0]], H[rig[i][0]]) - tmp;
  }
  count_lb = Orthogonal(lb);
  count_ub = Orthogonal(ub);
}

int jump(int x, int k, const vector <vector <int>> &anc) {
  for (int i = 0; i <= lg; i++)
    if (k >> i & 1)
      x = anc[x][i];
  return x;
}

int max_towers(int l, int r, int d) {
  l += 1;
  r += 1;
  int smaller_lb = count_lb.query(l, r + 1, d);
  int smaller_ub = count_ub.query(l, r + 1, d);
  int lo = 0, hi = r - l + 1;
  while (lo < hi) {
    int mid = (lo + hi) / 2;
    int node = jump(l, mid, rig);
    if (rig[node][0] <= r && lb[node] < d)
      lo = mid + 1;
    else
      hi = mid;
  }
  smaller_lb -= lo;
  lo = 0, hi = r - l + 1;
  while (lo < hi) {
    int mid = (lo + hi) / 2;
    int node = jump(r, mid, lft);
    if (lft[node][0] >= l && lb[node] < d)
      lo = mid + 1;
    else
      hi = mid;
  }
  smaller_lb -= lo;
  lo = 0, hi = r - l + 1;
  while (lo < hi) {
    int mid = (lo + hi) / 2;
    int node = jump(l, mid, rig);
    if (rig[node][0] <= r && H[node] - mini.query(l, rig[node][0]) < d)
      lo = mid + 1;
    else
      hi = mid;
  }
  smaller_lb += lo;
  lo = 0, hi = r - l + 1;
  while (lo < hi) {
    int mid = (lo + hi) / 2;
    int node = jump(r, mid, lft);
    if (lft[node][0] >= l && H[node] - mini.query(lft[node][0] + 1, r + 1) < d)
      lo = mid + 1;
    else
      hi = mid;
  }
  smaller_lb += lo;
  lo = 0, hi = r - l + 1;
  while (lo < hi) {
    int mid = (lo + hi) / 2;
    int node = jump(l, mid, rig);
    if (rig[node][0] <= r && ub[node] < d)
      lo = mid + 1;
    else
      hi = mid;
  }
  smaller_ub -= lo;
  lo = 0, hi = r - l + 1;
  while (lo < hi) {
    int mid = (lo + hi) / 2;
    int node = jump(r, mid, lft);
    if (lft[node][0] >= l && ub[node] < d)
      lo = mid + 1;
    else
      hi = mid;
  }
  smaller_ub -= lo;
  lo = 0, hi = r - l + 1;
  while (lo < hi) {
    int mid = (lo + hi) / 2;
    int node = jump(l, mid, rig);
    if (rig[node][0] <= r && H[rig[node][0]] - mini.query(l, rig[node][0]) < d)
      lo = mid + 1;
    else
      hi = mid;
  }
  smaller_ub += lo;
  lo = 0, hi = r - l + 1;
  while (lo < hi) {
    int mid = (lo + hi) / 2;
    int node = jump(r, mid, lft);
    if (lft[node][0] >= l && H[lft[node][0]] - mini.query(lft[node][0] + 1, r + 1) < d)
      lo = mid + 1;
    else
      hi = mid;
  }
  smaller_ub += lo;
  lo = 0, hi = r - l + 1;
  while (lo < hi) {
    int mid = (lo + hi) / 2;
    int node = jump(l, mid, rig);
    if (rig[node][0] <= r)
      lo = mid + 1;
    else
      hi = mid;
  }
  int arg_max = jump(l, lo, rig);
  smaller_lb -= lb[arg_max] < d;
  smaller_lb += H[arg_max] - mini.query(l, r + 1) < d;
  smaller_ub -= ub[arg_max] < d;
  return smaller_lb - smaller_ub;
}

Compilation message

towers.cpp: In constructor 'RMQ::RMQ(std::vector<int>)':
towers.cpp:12:29: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   12 |     for (offset = 1; offset < vals.size(); offset *= 2);
      |                      ~~~~~~~^~~~~~~~~~~~~
towers.cpp:15:28: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   15 |       tour[i + offset] = i < vals.size() ? vals[i] : INF;
      |                          ~~^~~~~~~~~~~~~
towers.cpp: In constructor 'Orthogonal::Orthogonal(std::vector<int>)':
towers.cpp:38:29: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   38 |     for (offset = 1; offset < vals.size(); offset *= 2);
      |                      ~~~~~~~^~~~~~~~~~~~~
towers.cpp:40:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   40 |     for (int i = 1; i < vals.size(); i++)
      |                     ~~^~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 1608 ms 34224 KB Output is correct
2 Correct 3870 ms 60176 KB Output is correct
3 Correct 3800 ms 60196 KB Output is correct
4 Execution timed out 4059 ms 60108 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 464 KB Output is correct
2 Correct 2 ms 1232 KB Output is correct
3 Correct 2 ms 1232 KB Output is correct
4 Correct 2 ms 1232 KB Output is correct
5 Correct 2 ms 1232 KB Output is correct
6 Correct 2 ms 1232 KB Output is correct
7 Correct 2 ms 1232 KB Output is correct
8 Correct 2 ms 1232 KB Output is correct
9 Correct 2 ms 1232 KB Output is correct
10 Correct 2 ms 1348 KB Output is correct
11 Correct 2 ms 1232 KB Output is correct
12 Correct 0 ms 208 KB Output is correct
13 Correct 2 ms 1232 KB Output is correct
14 Correct 3 ms 1232 KB Output is correct
15 Correct 2 ms 1232 KB Output is correct
16 Correct 2 ms 1232 KB Output is correct
17 Correct 2 ms 1232 KB Output is correct
18 Correct 2 ms 1232 KB Output is correct
19 Correct 2 ms 1232 KB Output is correct
20 Correct 2 ms 1232 KB Output is correct
21 Correct 2 ms 1232 KB Output is correct
22 Correct 3 ms 1232 KB Output is correct
23 Correct 2 ms 1232 KB Output is correct
24 Correct 2 ms 1232 KB Output is correct
25 Correct 1 ms 720 KB Output is correct
26 Correct 2 ms 1232 KB Output is correct
27 Correct 2 ms 1232 KB Output is correct
28 Correct 2 ms 1232 KB Output is correct
29 Correct 2 ms 1232 KB Output is correct
30 Correct 2 ms 1232 KB Output is correct
31 Correct 2 ms 1232 KB Output is correct
32 Correct 2 ms 1232 KB Output is correct
33 Correct 2 ms 1232 KB Output is correct
34 Correct 2 ms 1232 KB Output is correct
35 Correct 2 ms 1232 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 464 KB Output is correct
2 Correct 2 ms 1232 KB Output is correct
3 Correct 2 ms 1232 KB Output is correct
4 Correct 2 ms 1232 KB Output is correct
5 Correct 2 ms 1232 KB Output is correct
6 Correct 2 ms 1232 KB Output is correct
7 Correct 2 ms 1232 KB Output is correct
8 Correct 2 ms 1232 KB Output is correct
9 Correct 2 ms 1232 KB Output is correct
10 Correct 2 ms 1348 KB Output is correct
11 Correct 2 ms 1232 KB Output is correct
12 Correct 0 ms 208 KB Output is correct
13 Correct 2 ms 1232 KB Output is correct
14 Correct 3 ms 1232 KB Output is correct
15 Correct 2 ms 1232 KB Output is correct
16 Correct 2 ms 1232 KB Output is correct
17 Correct 2 ms 1232 KB Output is correct
18 Correct 2 ms 1232 KB Output is correct
19 Correct 2 ms 1232 KB Output is correct
20 Correct 2 ms 1232 KB Output is correct
21 Correct 2 ms 1232 KB Output is correct
22 Correct 3 ms 1232 KB Output is correct
23 Correct 2 ms 1232 KB Output is correct
24 Correct 2 ms 1232 KB Output is correct
25 Correct 1 ms 720 KB Output is correct
26 Correct 2 ms 1232 KB Output is correct
27 Correct 2 ms 1232 KB Output is correct
28 Correct 2 ms 1232 KB Output is correct
29 Correct 2 ms 1232 KB Output is correct
30 Correct 2 ms 1232 KB Output is correct
31 Correct 2 ms 1232 KB Output is correct
32 Correct 2 ms 1232 KB Output is correct
33 Correct 2 ms 1232 KB Output is correct
34 Correct 2 ms 1232 KB Output is correct
35 Correct 2 ms 1232 KB Output is correct
36 Correct 73 ms 36424 KB Output is correct
37 Correct 125 ms 59720 KB Output is correct
38 Correct 124 ms 59816 KB Output is correct
39 Correct 115 ms 59748 KB Output is correct
40 Correct 124 ms 59748 KB Output is correct
41 Correct 111 ms 59700 KB Output is correct
42 Correct 109 ms 59924 KB Output is correct
43 Correct 105 ms 60240 KB Output is correct
44 Correct 112 ms 59884 KB Output is correct
45 Correct 107 ms 59932 KB Output is correct
46 Correct 103 ms 59792 KB Output is correct
47 Correct 113 ms 59796 KB Output is correct
48 Correct 110 ms 59704 KB Output is correct
49 Correct 113 ms 59824 KB Output is correct
50 Correct 131 ms 59748 KB Output is correct
51 Correct 105 ms 60144 KB Output is correct
52 Correct 115 ms 59796 KB Output is correct
53 Correct 111 ms 59828 KB Output is correct
54 Correct 110 ms 59704 KB Output is correct
55 Correct 110 ms 59816 KB Output is correct
56 Correct 107 ms 59948 KB Output is correct
57 Correct 111 ms 58268 KB Output is correct
58 Correct 114 ms 59800 KB Output is correct
59 Correct 116 ms 59696 KB Output is correct
60 Correct 114 ms 59704 KB Output is correct
61 Correct 126 ms 60008 KB Output is correct
62 Correct 110 ms 59692 KB Output is correct
63 Correct 110 ms 59792 KB Output is correct
64 Correct 105 ms 60180 KB Output is correct
65 Correct 122 ms 59720 KB Output is correct
66 Correct 107 ms 59948 KB Output is correct
67 Correct 106 ms 59736 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2060 ms 59500 KB Output is correct
2 Correct 2561 ms 59756 KB Output is correct
3 Correct 2440 ms 59712 KB Output is correct
4 Correct 2564 ms 59772 KB Output is correct
5 Correct 2536 ms 59696 KB Output is correct
6 Correct 2517 ms 59820 KB Output is correct
7 Correct 2457 ms 59712 KB Output is correct
8 Correct 3565 ms 60108 KB Output is correct
9 Correct 2906 ms 59740 KB Output is correct
10 Correct 3336 ms 60100 KB Output is correct
11 Correct 2952 ms 59728 KB Output is correct
12 Correct 3344 ms 60140 KB Output is correct
13 Correct 2847 ms 59840 KB Output is correct
14 Correct 0 ms 208 KB Output is correct
15 Correct 2 ms 1232 KB Output is correct
16 Correct 2 ms 1232 KB Output is correct
17 Correct 121 ms 59808 KB Output is correct
18 Correct 117 ms 59796 KB Output is correct
19 Correct 110 ms 59724 KB Output is correct
20 Correct 104 ms 59720 KB Output is correct
21 Correct 109 ms 60160 KB Output is correct
22 Correct 113 ms 59720 KB Output is correct
23 Correct 111 ms 59792 KB Output is correct
24 Correct 118 ms 59820 KB Output is correct
25 Correct 104 ms 59724 KB Output is correct
26 Correct 112 ms 59968 KB Output is correct
27 Correct 2 ms 1232 KB Output is correct
28 Correct 2 ms 1232 KB Output is correct
29 Correct 2 ms 1232 KB Output is correct
30 Correct 2 ms 1232 KB Output is correct
31 Correct 2 ms 1232 KB Output is correct
32 Correct 2 ms 1232 KB Output is correct
33 Correct 2 ms 1232 KB Output is correct
34 Correct 2 ms 1232 KB Output is correct
35 Correct 2 ms 1180 KB Output is correct
36 Correct 2 ms 1232 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 553 ms 14292 KB Output is correct
2 Correct 1753 ms 59804 KB Output is correct
3 Correct 2097 ms 59832 KB Output is correct
4 Correct 2108 ms 59708 KB Output is correct
5 Correct 2039 ms 59712 KB Output is correct
6 Correct 1777 ms 59824 KB Output is correct
7 Correct 1980 ms 59752 KB Output is correct
8 Correct 3046 ms 60184 KB Output is correct
9 Correct 2726 ms 59724 KB Output is correct
10 Correct 2467 ms 59968 KB Output is correct
11 Correct 2284 ms 59728 KB Output is correct
12 Correct 120 ms 59816 KB Output is correct
13 Correct 112 ms 59800 KB Output is correct
14 Correct 110 ms 59700 KB Output is correct
15 Correct 103 ms 59736 KB Output is correct
16 Correct 105 ms 59952 KB Output is correct
17 Correct 110 ms 58148 KB Output is correct
18 Correct 114 ms 59712 KB Output is correct
19 Correct 116 ms 59800 KB Output is correct
20 Correct 117 ms 59712 KB Output is correct
21 Correct 115 ms 59804 KB Output is correct
22 Correct 118 ms 59768 KB Output is correct
23 Correct 110 ms 59796 KB Output is correct
24 Correct 103 ms 60188 KB Output is correct
25 Correct 110 ms 59728 KB Output is correct
26 Correct 104 ms 59904 KB Output is correct
27 Correct 106 ms 59760 KB Output is correct
28 Correct 2 ms 1232 KB Output is correct
29 Correct 2 ms 1232 KB Output is correct
30 Correct 2 ms 1232 KB Output is correct
31 Correct 2 ms 1232 KB Output is correct
32 Correct 2 ms 1232 KB Output is correct
33 Correct 1 ms 720 KB Output is correct
34 Correct 2 ms 1232 KB Output is correct
35 Correct 2 ms 1232 KB Output is correct
36 Correct 2 ms 1232 KB Output is correct
37 Correct 2 ms 1232 KB Output is correct
38 Correct 2 ms 1232 KB Output is correct
39 Correct 2 ms 1232 KB Output is correct
40 Correct 2 ms 1232 KB Output is correct
41 Correct 2 ms 1232 KB Output is correct
42 Correct 2 ms 1232 KB Output is correct
43 Correct 2 ms 1232 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 464 KB Output is correct
2 Correct 2 ms 1232 KB Output is correct
3 Correct 2 ms 1232 KB Output is correct
4 Correct 2 ms 1232 KB Output is correct
5 Correct 2 ms 1232 KB Output is correct
6 Correct 2 ms 1232 KB Output is correct
7 Correct 2 ms 1232 KB Output is correct
8 Correct 2 ms 1232 KB Output is correct
9 Correct 2 ms 1232 KB Output is correct
10 Correct 2 ms 1348 KB Output is correct
11 Correct 2 ms 1232 KB Output is correct
12 Correct 0 ms 208 KB Output is correct
13 Correct 2 ms 1232 KB Output is correct
14 Correct 3 ms 1232 KB Output is correct
15 Correct 2 ms 1232 KB Output is correct
16 Correct 2 ms 1232 KB Output is correct
17 Correct 2 ms 1232 KB Output is correct
18 Correct 2 ms 1232 KB Output is correct
19 Correct 2 ms 1232 KB Output is correct
20 Correct 2 ms 1232 KB Output is correct
21 Correct 2 ms 1232 KB Output is correct
22 Correct 3 ms 1232 KB Output is correct
23 Correct 2 ms 1232 KB Output is correct
24 Correct 2 ms 1232 KB Output is correct
25 Correct 1 ms 720 KB Output is correct
26 Correct 2 ms 1232 KB Output is correct
27 Correct 2 ms 1232 KB Output is correct
28 Correct 2 ms 1232 KB Output is correct
29 Correct 2 ms 1232 KB Output is correct
30 Correct 2 ms 1232 KB Output is correct
31 Correct 2 ms 1232 KB Output is correct
32 Correct 2 ms 1232 KB Output is correct
33 Correct 2 ms 1232 KB Output is correct
34 Correct 2 ms 1232 KB Output is correct
35 Correct 2 ms 1232 KB Output is correct
36 Correct 73 ms 36424 KB Output is correct
37 Correct 125 ms 59720 KB Output is correct
38 Correct 124 ms 59816 KB Output is correct
39 Correct 115 ms 59748 KB Output is correct
40 Correct 124 ms 59748 KB Output is correct
41 Correct 111 ms 59700 KB Output is correct
42 Correct 109 ms 59924 KB Output is correct
43 Correct 105 ms 60240 KB Output is correct
44 Correct 112 ms 59884 KB Output is correct
45 Correct 107 ms 59932 KB Output is correct
46 Correct 103 ms 59792 KB Output is correct
47 Correct 113 ms 59796 KB Output is correct
48 Correct 110 ms 59704 KB Output is correct
49 Correct 113 ms 59824 KB Output is correct
50 Correct 131 ms 59748 KB Output is correct
51 Correct 105 ms 60144 KB Output is correct
52 Correct 115 ms 59796 KB Output is correct
53 Correct 111 ms 59828 KB Output is correct
54 Correct 110 ms 59704 KB Output is correct
55 Correct 110 ms 59816 KB Output is correct
56 Correct 107 ms 59948 KB Output is correct
57 Correct 111 ms 58268 KB Output is correct
58 Correct 114 ms 59800 KB Output is correct
59 Correct 116 ms 59696 KB Output is correct
60 Correct 114 ms 59704 KB Output is correct
61 Correct 126 ms 60008 KB Output is correct
62 Correct 110 ms 59692 KB Output is correct
63 Correct 110 ms 59792 KB Output is correct
64 Correct 105 ms 60180 KB Output is correct
65 Correct 122 ms 59720 KB Output is correct
66 Correct 107 ms 59948 KB Output is correct
67 Correct 106 ms 59736 KB Output is correct
68 Correct 2060 ms 59500 KB Output is correct
69 Correct 2561 ms 59756 KB Output is correct
70 Correct 2440 ms 59712 KB Output is correct
71 Correct 2564 ms 59772 KB Output is correct
72 Correct 2536 ms 59696 KB Output is correct
73 Correct 2517 ms 59820 KB Output is correct
74 Correct 2457 ms 59712 KB Output is correct
75 Correct 3565 ms 60108 KB Output is correct
76 Correct 2906 ms 59740 KB Output is correct
77 Correct 3336 ms 60100 KB Output is correct
78 Correct 2952 ms 59728 KB Output is correct
79 Correct 3344 ms 60140 KB Output is correct
80 Correct 2847 ms 59840 KB Output is correct
81 Correct 0 ms 208 KB Output is correct
82 Correct 2 ms 1232 KB Output is correct
83 Correct 2 ms 1232 KB Output is correct
84 Correct 121 ms 59808 KB Output is correct
85 Correct 117 ms 59796 KB Output is correct
86 Correct 110 ms 59724 KB Output is correct
87 Correct 104 ms 59720 KB Output is correct
88 Correct 109 ms 60160 KB Output is correct
89 Correct 113 ms 59720 KB Output is correct
90 Correct 111 ms 59792 KB Output is correct
91 Correct 118 ms 59820 KB Output is correct
92 Correct 104 ms 59724 KB Output is correct
93 Correct 112 ms 59968 KB Output is correct
94 Correct 2 ms 1232 KB Output is correct
95 Correct 2 ms 1232 KB Output is correct
96 Correct 2 ms 1232 KB Output is correct
97 Correct 2 ms 1232 KB Output is correct
98 Correct 2 ms 1232 KB Output is correct
99 Correct 2 ms 1232 KB Output is correct
100 Correct 2 ms 1232 KB Output is correct
101 Correct 2 ms 1232 KB Output is correct
102 Correct 2 ms 1180 KB Output is correct
103 Correct 2 ms 1232 KB Output is correct
104 Correct 2311 ms 54644 KB Output is correct
105 Correct 2603 ms 59724 KB Output is correct
106 Correct 2532 ms 59840 KB Output is correct
107 Correct 2560 ms 59944 KB Output is correct
108 Correct 2568 ms 59704 KB Output is correct
109 Correct 2544 ms 59832 KB Output is correct
110 Correct 2412 ms 59728 KB Output is correct
111 Correct 3817 ms 60116 KB Output is correct
112 Correct 3631 ms 59840 KB Output is correct
113 Correct 3730 ms 59840 KB Output is correct
114 Correct 3672 ms 59800 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1608 ms 34224 KB Output is correct
2 Correct 3870 ms 60176 KB Output is correct
3 Correct 3800 ms 60196 KB Output is correct
4 Execution timed out 4059 ms 60108 KB Time limit exceeded
5 Halted 0 ms 0 KB -