#include "towers.h"
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100005;
struct node{
int s, m, e, val;
node *l, *r;
node(int _s, int _e, vector<int> &arr){
s = _s, e = _e, m = (s + e) >> 1;
if (s == e) val = arr[s];
else{
l = new node(s, m, arr); r = new node(m + 1, e, arr);
val = max(l->val, r->val);
}
}
int query(int x, int y){
if (x > y) return -1;
if (x == s && y == e) return val;
else if (y <= m) return l->query(x, y);
else if (x > m) return r->query(x, y);
else return max(l->query(x, m), r->query(m + 1, y));
}
};
struct node2{
int s, m, e, val;
node2 *l = nullptr, *r = nullptr;
node2 (int _s, int _e){
s = _s, e = _e, m = (s + e) >> 1, val = 0;
if (s != e){
l = new node2(s, m); r = new node2(m + 1, e);
}
}
node2 (node2 *x){
s = x->s, e = x->e, m = x->m, val = x->val;
l = x->l; r = x->r;
}
void update(int p, int v){
val += v;
if (s == e) return;
else if (p <= m){
l = new node2(l); l->update(p, v);
}
else{
r = new node2(r); r->update(p, v);
}
}
int cnt(int x, int y){
if (x == s && y == e) return val;
else if (y <= m) return l->cnt(x, y);
else if (x > m) return r->cnt(x, y);
else return l->cnt(x, m) + r->cnt(m + 1, y);
}
int lf(int x, int y){
if (val == 0) return -1;
if (s == e) return s;
else if (y <= m) return l->lf(x, y);
else if (x > m) return r->lf(x, y);
else{
int v = l->lf(x, m);
return (v != -1 ? v : r->lf(m + 1, y));
}
}
int rf(int x, int y){
if (val == 0) return -1;
if (s == e) return s;
else if (y <= m) return l->rf(x, y);
else if (x > m) return r->rf(x, y);
else{
int v = r->rf(m + 1, y);
return (v != -1 ? v : l->rf(x, m));
}
}
};
node *lst, *rst;
node2 *proots[MAXN];
vector<int> disc; int dsz;
void init(int N, vector<int> H){
node *root = new node(0, N - 1, H);
vector<int> ld(N), rd(N), fd(N);
vector<int> st; st.push_back(-1);
for (int i = 0; i < N; i++){
while (st.back() != -1 && H[st.back()] > H[i]) st.pop_back();
ld[i] = max(0, root->query(st.back() + 1, i - 1) - H[i]);
st.push_back(i);
}
st.clear(); st.push_back(N);
for (int i = N - 1; i >= 0; i--){
while (st.back() != N && H[st.back()] > H[i]) st.pop_back();
rd[i] = max(0, root->query(i + 1, st.back() - 1) - H[i]);
st.push_back(i);
}
lst = new node(0, N - 1, ld); rst = new node(0, N - 1, rd);
for (int i = 0; i < N; i++){
fd[i] = min(ld[i], rd[i]);
disc.push_back(fd[i]);
}
sort(disc.begin(), disc.end());
disc.resize(distance(disc.begin(), unique(disc.begin(), disc.end())));
dsz = disc.size();
vector<vector<int>> ord(dsz + 1);
for (int i = 0; i < N; i++){
int id = lower_bound(disc.begin(), disc.end(), fd[i]) - disc.begin();
ord[dsz - id].push_back(i);
}
proots[0] = new node2(0, N - 1);
for (int i = 1; i <= dsz; i++){
proots[i] = new node2(proots[i - 1]);
for (int x : ord[i]) proots[i]->update(x, 1);
}
}
int max_towers(int L, int R, int D){
int id = dsz - (lower_bound(disc.begin(), disc.end(), D) - disc.begin());
int ans = proots[id]->cnt(L, R);
int lb = (ans == 0 ? R + 1 : proots[id]->lf(L, R)), rb = (ans == 0 ? L - 1 : proots[id]->rf(L, R));
if (rst->query(L, lb - 1) >= D) ans++;
if (lst->query(rb + 1, R) >= D) ans++;
return max(ans, 1);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
537 ms |
69180 KB |
Output is correct |
2 |
Correct |
1234 ms |
119468 KB |
Output is correct |
3 |
Correct |
1274 ms |
119476 KB |
Output is correct |
4 |
Correct |
1185 ms |
119520 KB |
Output is correct |
5 |
Correct |
1190 ms |
119412 KB |
Output is correct |
6 |
Correct |
1236 ms |
119336 KB |
Output is correct |
7 |
Correct |
1174 ms |
119472 KB |
Output is correct |
8 |
Correct |
1 ms |
344 KB |
Output is correct |
9 |
Correct |
3 ms |
2136 KB |
Output is correct |
10 |
Correct |
2 ms |
2136 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
600 KB |
Output is correct |
2 |
Correct |
3 ms |
2224 KB |
Output is correct |
3 |
Correct |
3 ms |
2136 KB |
Output is correct |
4 |
Correct |
3 ms |
2136 KB |
Output is correct |
5 |
Correct |
3 ms |
2288 KB |
Output is correct |
6 |
Correct |
3 ms |
2136 KB |
Output is correct |
7 |
Correct |
3 ms |
2136 KB |
Output is correct |
8 |
Correct |
2 ms |
2136 KB |
Output is correct |
9 |
Correct |
3 ms |
2136 KB |
Output is correct |
10 |
Correct |
2 ms |
2136 KB |
Output is correct |
11 |
Correct |
2 ms |
2136 KB |
Output is correct |
12 |
Correct |
1 ms |
344 KB |
Output is correct |
13 |
Correct |
3 ms |
2136 KB |
Output is correct |
14 |
Correct |
3 ms |
2136 KB |
Output is correct |
15 |
Correct |
2 ms |
2136 KB |
Output is correct |
16 |
Correct |
4 ms |
2136 KB |
Output is correct |
17 |
Correct |
3 ms |
2136 KB |
Output is correct |
18 |
Correct |
4 ms |
2136 KB |
Output is correct |
19 |
Correct |
3 ms |
2136 KB |
Output is correct |
20 |
Correct |
3 ms |
2132 KB |
Output is correct |
21 |
Correct |
3 ms |
2136 KB |
Output is correct |
22 |
Correct |
3 ms |
2136 KB |
Output is correct |
23 |
Correct |
3 ms |
2136 KB |
Output is correct |
24 |
Correct |
3 ms |
2136 KB |
Output is correct |
25 |
Correct |
2 ms |
1112 KB |
Output is correct |
26 |
Correct |
2 ms |
2136 KB |
Output is correct |
27 |
Correct |
4 ms |
2136 KB |
Output is correct |
28 |
Correct |
3 ms |
2376 KB |
Output is correct |
29 |
Correct |
3 ms |
2136 KB |
Output is correct |
30 |
Correct |
3 ms |
2136 KB |
Output is correct |
31 |
Correct |
3 ms |
2136 KB |
Output is correct |
32 |
Correct |
2 ms |
2136 KB |
Output is correct |
33 |
Correct |
3 ms |
2136 KB |
Output is correct |
34 |
Correct |
3 ms |
2136 KB |
Output is correct |
35 |
Correct |
2 ms |
2136 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
600 KB |
Output is correct |
2 |
Correct |
3 ms |
2224 KB |
Output is correct |
3 |
Correct |
3 ms |
2136 KB |
Output is correct |
4 |
Correct |
3 ms |
2136 KB |
Output is correct |
5 |
Correct |
3 ms |
2288 KB |
Output is correct |
6 |
Correct |
3 ms |
2136 KB |
Output is correct |
7 |
Correct |
3 ms |
2136 KB |
Output is correct |
8 |
Correct |
2 ms |
2136 KB |
Output is correct |
9 |
Correct |
3 ms |
2136 KB |
Output is correct |
10 |
Correct |
2 ms |
2136 KB |
Output is correct |
11 |
Correct |
2 ms |
2136 KB |
Output is correct |
12 |
Correct |
1 ms |
344 KB |
Output is correct |
13 |
Correct |
3 ms |
2136 KB |
Output is correct |
14 |
Correct |
3 ms |
2136 KB |
Output is correct |
15 |
Correct |
2 ms |
2136 KB |
Output is correct |
16 |
Correct |
4 ms |
2136 KB |
Output is correct |
17 |
Correct |
3 ms |
2136 KB |
Output is correct |
18 |
Correct |
4 ms |
2136 KB |
Output is correct |
19 |
Correct |
3 ms |
2136 KB |
Output is correct |
20 |
Correct |
3 ms |
2132 KB |
Output is correct |
21 |
Correct |
3 ms |
2136 KB |
Output is correct |
22 |
Correct |
3 ms |
2136 KB |
Output is correct |
23 |
Correct |
3 ms |
2136 KB |
Output is correct |
24 |
Correct |
3 ms |
2136 KB |
Output is correct |
25 |
Correct |
2 ms |
1112 KB |
Output is correct |
26 |
Correct |
2 ms |
2136 KB |
Output is correct |
27 |
Correct |
4 ms |
2136 KB |
Output is correct |
28 |
Correct |
3 ms |
2376 KB |
Output is correct |
29 |
Correct |
3 ms |
2136 KB |
Output is correct |
30 |
Correct |
3 ms |
2136 KB |
Output is correct |
31 |
Correct |
3 ms |
2136 KB |
Output is correct |
32 |
Correct |
2 ms |
2136 KB |
Output is correct |
33 |
Correct |
3 ms |
2136 KB |
Output is correct |
34 |
Correct |
3 ms |
2136 KB |
Output is correct |
35 |
Correct |
2 ms |
2136 KB |
Output is correct |
36 |
Correct |
102 ms |
77776 KB |
Output is correct |
37 |
Correct |
170 ms |
122616 KB |
Output is correct |
38 |
Correct |
187 ms |
122536 KB |
Output is correct |
39 |
Correct |
178 ms |
124336 KB |
Output is correct |
40 |
Correct |
197 ms |
124276 KB |
Output is correct |
41 |
Correct |
221 ms |
124400 KB |
Output is correct |
42 |
Correct |
175 ms |
124604 KB |
Output is correct |
43 |
Correct |
124 ms |
119452 KB |
Output is correct |
44 |
Correct |
124 ms |
119504 KB |
Output is correct |
45 |
Correct |
115 ms |
119296 KB |
Output is correct |
46 |
Correct |
117 ms |
119344 KB |
Output is correct |
47 |
Correct |
171 ms |
122468 KB |
Output is correct |
48 |
Correct |
196 ms |
124304 KB |
Output is correct |
49 |
Correct |
169 ms |
124244 KB |
Output is correct |
50 |
Correct |
119 ms |
119296 KB |
Output is correct |
51 |
Correct |
120 ms |
119324 KB |
Output is correct |
52 |
Correct |
165 ms |
122500 KB |
Output is correct |
53 |
Correct |
199 ms |
124212 KB |
Output is correct |
54 |
Correct |
198 ms |
124292 KB |
Output is correct |
55 |
Correct |
112 ms |
119480 KB |
Output is correct |
56 |
Correct |
126 ms |
119356 KB |
Output is correct |
57 |
Correct |
175 ms |
118120 KB |
Output is correct |
58 |
Correct |
164 ms |
122492 KB |
Output is correct |
59 |
Correct |
165 ms |
122536 KB |
Output is correct |
60 |
Correct |
172 ms |
124312 KB |
Output is correct |
61 |
Correct |
170 ms |
124348 KB |
Output is correct |
62 |
Correct |
196 ms |
124324 KB |
Output is correct |
63 |
Correct |
182 ms |
124360 KB |
Output is correct |
64 |
Correct |
120 ms |
119488 KB |
Output is correct |
65 |
Correct |
112 ms |
119540 KB |
Output is correct |
66 |
Correct |
124 ms |
119324 KB |
Output is correct |
67 |
Correct |
114 ms |
119376 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
866 ms |
121516 KB |
Output is correct |
2 |
Correct |
1149 ms |
122556 KB |
Output is correct |
3 |
Correct |
1069 ms |
122476 KB |
Output is correct |
4 |
Correct |
1039 ms |
124288 KB |
Output is correct |
5 |
Correct |
1092 ms |
124388 KB |
Output is correct |
6 |
Correct |
1039 ms |
124332 KB |
Output is correct |
7 |
Correct |
1091 ms |
124240 KB |
Output is correct |
8 |
Correct |
1157 ms |
119404 KB |
Output is correct |
9 |
Correct |
1104 ms |
119424 KB |
Output is correct |
10 |
Correct |
1099 ms |
119228 KB |
Output is correct |
11 |
Correct |
1097 ms |
119216 KB |
Output is correct |
12 |
Correct |
1126 ms |
119484 KB |
Output is correct |
13 |
Correct |
1149 ms |
119324 KB |
Output is correct |
14 |
Correct |
1 ms |
344 KB |
Output is correct |
15 |
Correct |
4 ms |
2136 KB |
Output is correct |
16 |
Correct |
2 ms |
2136 KB |
Output is correct |
17 |
Correct |
167 ms |
122656 KB |
Output is correct |
18 |
Correct |
185 ms |
124392 KB |
Output is correct |
19 |
Correct |
179 ms |
124304 KB |
Output is correct |
20 |
Correct |
130 ms |
119400 KB |
Output is correct |
21 |
Correct |
121 ms |
119504 KB |
Output is correct |
22 |
Correct |
194 ms |
122448 KB |
Output is correct |
23 |
Correct |
196 ms |
124440 KB |
Output is correct |
24 |
Correct |
185 ms |
124280 KB |
Output is correct |
25 |
Correct |
129 ms |
119280 KB |
Output is correct |
26 |
Correct |
122 ms |
119104 KB |
Output is correct |
27 |
Correct |
3 ms |
2136 KB |
Output is correct |
28 |
Correct |
3 ms |
2136 KB |
Output is correct |
29 |
Correct |
3 ms |
2136 KB |
Output is correct |
30 |
Correct |
2 ms |
2136 KB |
Output is correct |
31 |
Correct |
2 ms |
2136 KB |
Output is correct |
32 |
Correct |
2 ms |
2136 KB |
Output is correct |
33 |
Correct |
3 ms |
2136 KB |
Output is correct |
34 |
Correct |
3 ms |
2136 KB |
Output is correct |
35 |
Correct |
2 ms |
2136 KB |
Output is correct |
36 |
Correct |
2 ms |
2136 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
206 ms |
27288 KB |
Output is correct |
2 |
Correct |
840 ms |
122740 KB |
Output is correct |
3 |
Correct |
887 ms |
122476 KB |
Output is correct |
4 |
Correct |
856 ms |
124376 KB |
Output is correct |
5 |
Correct |
867 ms |
124328 KB |
Output is correct |
6 |
Correct |
930 ms |
124292 KB |
Output is correct |
7 |
Correct |
875 ms |
124348 KB |
Output is correct |
8 |
Correct |
648 ms |
119516 KB |
Output is correct |
9 |
Correct |
672 ms |
119480 KB |
Output is correct |
10 |
Correct |
704 ms |
119228 KB |
Output is correct |
11 |
Correct |
771 ms |
119352 KB |
Output is correct |
12 |
Correct |
176 ms |
122600 KB |
Output is correct |
13 |
Correct |
194 ms |
124332 KB |
Output is correct |
14 |
Correct |
185 ms |
124332 KB |
Output is correct |
15 |
Correct |
120 ms |
119476 KB |
Output is correct |
16 |
Correct |
117 ms |
119240 KB |
Output is correct |
17 |
Correct |
161 ms |
118184 KB |
Output is correct |
18 |
Correct |
166 ms |
122644 KB |
Output is correct |
19 |
Correct |
188 ms |
122528 KB |
Output is correct |
20 |
Correct |
167 ms |
124328 KB |
Output is correct |
21 |
Correct |
188 ms |
124584 KB |
Output is correct |
22 |
Correct |
179 ms |
124336 KB |
Output is correct |
23 |
Correct |
177 ms |
124204 KB |
Output is correct |
24 |
Correct |
120 ms |
119492 KB |
Output is correct |
25 |
Correct |
119 ms |
119492 KB |
Output is correct |
26 |
Correct |
118 ms |
119236 KB |
Output is correct |
27 |
Correct |
121 ms |
119476 KB |
Output is correct |
28 |
Correct |
2 ms |
2136 KB |
Output is correct |
29 |
Correct |
3 ms |
2136 KB |
Output is correct |
30 |
Correct |
3 ms |
2388 KB |
Output is correct |
31 |
Correct |
2 ms |
2332 KB |
Output is correct |
32 |
Correct |
2 ms |
2220 KB |
Output is correct |
33 |
Correct |
1 ms |
1112 KB |
Output is correct |
34 |
Correct |
3 ms |
2200 KB |
Output is correct |
35 |
Correct |
3 ms |
2136 KB |
Output is correct |
36 |
Correct |
3 ms |
2136 KB |
Output is correct |
37 |
Correct |
4 ms |
2136 KB |
Output is correct |
38 |
Correct |
3 ms |
2136 KB |
Output is correct |
39 |
Correct |
3 ms |
2136 KB |
Output is correct |
40 |
Correct |
4 ms |
2136 KB |
Output is correct |
41 |
Correct |
3 ms |
2136 KB |
Output is correct |
42 |
Correct |
3 ms |
2136 KB |
Output is correct |
43 |
Correct |
2 ms |
2136 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
600 KB |
Output is correct |
2 |
Correct |
3 ms |
2224 KB |
Output is correct |
3 |
Correct |
3 ms |
2136 KB |
Output is correct |
4 |
Correct |
3 ms |
2136 KB |
Output is correct |
5 |
Correct |
3 ms |
2288 KB |
Output is correct |
6 |
Correct |
3 ms |
2136 KB |
Output is correct |
7 |
Correct |
3 ms |
2136 KB |
Output is correct |
8 |
Correct |
2 ms |
2136 KB |
Output is correct |
9 |
Correct |
3 ms |
2136 KB |
Output is correct |
10 |
Correct |
2 ms |
2136 KB |
Output is correct |
11 |
Correct |
2 ms |
2136 KB |
Output is correct |
12 |
Correct |
1 ms |
344 KB |
Output is correct |
13 |
Correct |
3 ms |
2136 KB |
Output is correct |
14 |
Correct |
3 ms |
2136 KB |
Output is correct |
15 |
Correct |
2 ms |
2136 KB |
Output is correct |
16 |
Correct |
4 ms |
2136 KB |
Output is correct |
17 |
Correct |
3 ms |
2136 KB |
Output is correct |
18 |
Correct |
4 ms |
2136 KB |
Output is correct |
19 |
Correct |
3 ms |
2136 KB |
Output is correct |
20 |
Correct |
3 ms |
2132 KB |
Output is correct |
21 |
Correct |
3 ms |
2136 KB |
Output is correct |
22 |
Correct |
3 ms |
2136 KB |
Output is correct |
23 |
Correct |
3 ms |
2136 KB |
Output is correct |
24 |
Correct |
3 ms |
2136 KB |
Output is correct |
25 |
Correct |
2 ms |
1112 KB |
Output is correct |
26 |
Correct |
2 ms |
2136 KB |
Output is correct |
27 |
Correct |
4 ms |
2136 KB |
Output is correct |
28 |
Correct |
3 ms |
2376 KB |
Output is correct |
29 |
Correct |
3 ms |
2136 KB |
Output is correct |
30 |
Correct |
3 ms |
2136 KB |
Output is correct |
31 |
Correct |
3 ms |
2136 KB |
Output is correct |
32 |
Correct |
2 ms |
2136 KB |
Output is correct |
33 |
Correct |
3 ms |
2136 KB |
Output is correct |
34 |
Correct |
3 ms |
2136 KB |
Output is correct |
35 |
Correct |
2 ms |
2136 KB |
Output is correct |
36 |
Correct |
102 ms |
77776 KB |
Output is correct |
37 |
Correct |
170 ms |
122616 KB |
Output is correct |
38 |
Correct |
187 ms |
122536 KB |
Output is correct |
39 |
Correct |
178 ms |
124336 KB |
Output is correct |
40 |
Correct |
197 ms |
124276 KB |
Output is correct |
41 |
Correct |
221 ms |
124400 KB |
Output is correct |
42 |
Correct |
175 ms |
124604 KB |
Output is correct |
43 |
Correct |
124 ms |
119452 KB |
Output is correct |
44 |
Correct |
124 ms |
119504 KB |
Output is correct |
45 |
Correct |
115 ms |
119296 KB |
Output is correct |
46 |
Correct |
117 ms |
119344 KB |
Output is correct |
47 |
Correct |
171 ms |
122468 KB |
Output is correct |
48 |
Correct |
196 ms |
124304 KB |
Output is correct |
49 |
Correct |
169 ms |
124244 KB |
Output is correct |
50 |
Correct |
119 ms |
119296 KB |
Output is correct |
51 |
Correct |
120 ms |
119324 KB |
Output is correct |
52 |
Correct |
165 ms |
122500 KB |
Output is correct |
53 |
Correct |
199 ms |
124212 KB |
Output is correct |
54 |
Correct |
198 ms |
124292 KB |
Output is correct |
55 |
Correct |
112 ms |
119480 KB |
Output is correct |
56 |
Correct |
126 ms |
119356 KB |
Output is correct |
57 |
Correct |
175 ms |
118120 KB |
Output is correct |
58 |
Correct |
164 ms |
122492 KB |
Output is correct |
59 |
Correct |
165 ms |
122536 KB |
Output is correct |
60 |
Correct |
172 ms |
124312 KB |
Output is correct |
61 |
Correct |
170 ms |
124348 KB |
Output is correct |
62 |
Correct |
196 ms |
124324 KB |
Output is correct |
63 |
Correct |
182 ms |
124360 KB |
Output is correct |
64 |
Correct |
120 ms |
119488 KB |
Output is correct |
65 |
Correct |
112 ms |
119540 KB |
Output is correct |
66 |
Correct |
124 ms |
119324 KB |
Output is correct |
67 |
Correct |
114 ms |
119376 KB |
Output is correct |
68 |
Correct |
866 ms |
121516 KB |
Output is correct |
69 |
Correct |
1149 ms |
122556 KB |
Output is correct |
70 |
Correct |
1069 ms |
122476 KB |
Output is correct |
71 |
Correct |
1039 ms |
124288 KB |
Output is correct |
72 |
Correct |
1092 ms |
124388 KB |
Output is correct |
73 |
Correct |
1039 ms |
124332 KB |
Output is correct |
74 |
Correct |
1091 ms |
124240 KB |
Output is correct |
75 |
Correct |
1157 ms |
119404 KB |
Output is correct |
76 |
Correct |
1104 ms |
119424 KB |
Output is correct |
77 |
Correct |
1099 ms |
119228 KB |
Output is correct |
78 |
Correct |
1097 ms |
119216 KB |
Output is correct |
79 |
Correct |
1126 ms |
119484 KB |
Output is correct |
80 |
Correct |
1149 ms |
119324 KB |
Output is correct |
81 |
Correct |
1 ms |
344 KB |
Output is correct |
82 |
Correct |
4 ms |
2136 KB |
Output is correct |
83 |
Correct |
2 ms |
2136 KB |
Output is correct |
84 |
Correct |
167 ms |
122656 KB |
Output is correct |
85 |
Correct |
185 ms |
124392 KB |
Output is correct |
86 |
Correct |
179 ms |
124304 KB |
Output is correct |
87 |
Correct |
130 ms |
119400 KB |
Output is correct |
88 |
Correct |
121 ms |
119504 KB |
Output is correct |
89 |
Correct |
194 ms |
122448 KB |
Output is correct |
90 |
Correct |
196 ms |
124440 KB |
Output is correct |
91 |
Correct |
185 ms |
124280 KB |
Output is correct |
92 |
Correct |
129 ms |
119280 KB |
Output is correct |
93 |
Correct |
122 ms |
119104 KB |
Output is correct |
94 |
Correct |
3 ms |
2136 KB |
Output is correct |
95 |
Correct |
3 ms |
2136 KB |
Output is correct |
96 |
Correct |
3 ms |
2136 KB |
Output is correct |
97 |
Correct |
2 ms |
2136 KB |
Output is correct |
98 |
Correct |
2 ms |
2136 KB |
Output is correct |
99 |
Correct |
2 ms |
2136 KB |
Output is correct |
100 |
Correct |
3 ms |
2136 KB |
Output is correct |
101 |
Correct |
3 ms |
2136 KB |
Output is correct |
102 |
Correct |
2 ms |
2136 KB |
Output is correct |
103 |
Correct |
2 ms |
2136 KB |
Output is correct |
104 |
Correct |
951 ms |
108236 KB |
Output is correct |
105 |
Correct |
1064 ms |
122624 KB |
Output is correct |
106 |
Correct |
1078 ms |
122552 KB |
Output is correct |
107 |
Correct |
1176 ms |
124520 KB |
Output is correct |
108 |
Correct |
1176 ms |
124456 KB |
Output is correct |
109 |
Correct |
1204 ms |
124292 KB |
Output is correct |
110 |
Correct |
1090 ms |
124352 KB |
Output is correct |
111 |
Correct |
1112 ms |
119364 KB |
Output is correct |
112 |
Correct |
1143 ms |
119476 KB |
Output is correct |
113 |
Correct |
1079 ms |
119316 KB |
Output is correct |
114 |
Correct |
1092 ms |
119480 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
537 ms |
69180 KB |
Output is correct |
2 |
Correct |
1234 ms |
119468 KB |
Output is correct |
3 |
Correct |
1274 ms |
119476 KB |
Output is correct |
4 |
Correct |
1185 ms |
119520 KB |
Output is correct |
5 |
Correct |
1190 ms |
119412 KB |
Output is correct |
6 |
Correct |
1236 ms |
119336 KB |
Output is correct |
7 |
Correct |
1174 ms |
119472 KB |
Output is correct |
8 |
Correct |
1 ms |
344 KB |
Output is correct |
9 |
Correct |
3 ms |
2136 KB |
Output is correct |
10 |
Correct |
2 ms |
2136 KB |
Output is correct |
11 |
Correct |
2 ms |
600 KB |
Output is correct |
12 |
Correct |
3 ms |
2224 KB |
Output is correct |
13 |
Correct |
3 ms |
2136 KB |
Output is correct |
14 |
Correct |
3 ms |
2136 KB |
Output is correct |
15 |
Correct |
3 ms |
2288 KB |
Output is correct |
16 |
Correct |
3 ms |
2136 KB |
Output is correct |
17 |
Correct |
3 ms |
2136 KB |
Output is correct |
18 |
Correct |
2 ms |
2136 KB |
Output is correct |
19 |
Correct |
3 ms |
2136 KB |
Output is correct |
20 |
Correct |
2 ms |
2136 KB |
Output is correct |
21 |
Correct |
2 ms |
2136 KB |
Output is correct |
22 |
Correct |
1 ms |
344 KB |
Output is correct |
23 |
Correct |
3 ms |
2136 KB |
Output is correct |
24 |
Correct |
3 ms |
2136 KB |
Output is correct |
25 |
Correct |
2 ms |
2136 KB |
Output is correct |
26 |
Correct |
4 ms |
2136 KB |
Output is correct |
27 |
Correct |
3 ms |
2136 KB |
Output is correct |
28 |
Correct |
4 ms |
2136 KB |
Output is correct |
29 |
Correct |
3 ms |
2136 KB |
Output is correct |
30 |
Correct |
3 ms |
2132 KB |
Output is correct |
31 |
Correct |
3 ms |
2136 KB |
Output is correct |
32 |
Correct |
3 ms |
2136 KB |
Output is correct |
33 |
Correct |
3 ms |
2136 KB |
Output is correct |
34 |
Correct |
3 ms |
2136 KB |
Output is correct |
35 |
Correct |
2 ms |
1112 KB |
Output is correct |
36 |
Correct |
2 ms |
2136 KB |
Output is correct |
37 |
Correct |
4 ms |
2136 KB |
Output is correct |
38 |
Correct |
3 ms |
2376 KB |
Output is correct |
39 |
Correct |
3 ms |
2136 KB |
Output is correct |
40 |
Correct |
3 ms |
2136 KB |
Output is correct |
41 |
Correct |
3 ms |
2136 KB |
Output is correct |
42 |
Correct |
2 ms |
2136 KB |
Output is correct |
43 |
Correct |
3 ms |
2136 KB |
Output is correct |
44 |
Correct |
3 ms |
2136 KB |
Output is correct |
45 |
Correct |
2 ms |
2136 KB |
Output is correct |
46 |
Correct |
102 ms |
77776 KB |
Output is correct |
47 |
Correct |
170 ms |
122616 KB |
Output is correct |
48 |
Correct |
187 ms |
122536 KB |
Output is correct |
49 |
Correct |
178 ms |
124336 KB |
Output is correct |
50 |
Correct |
197 ms |
124276 KB |
Output is correct |
51 |
Correct |
221 ms |
124400 KB |
Output is correct |
52 |
Correct |
175 ms |
124604 KB |
Output is correct |
53 |
Correct |
124 ms |
119452 KB |
Output is correct |
54 |
Correct |
124 ms |
119504 KB |
Output is correct |
55 |
Correct |
115 ms |
119296 KB |
Output is correct |
56 |
Correct |
117 ms |
119344 KB |
Output is correct |
57 |
Correct |
171 ms |
122468 KB |
Output is correct |
58 |
Correct |
196 ms |
124304 KB |
Output is correct |
59 |
Correct |
169 ms |
124244 KB |
Output is correct |
60 |
Correct |
119 ms |
119296 KB |
Output is correct |
61 |
Correct |
120 ms |
119324 KB |
Output is correct |
62 |
Correct |
165 ms |
122500 KB |
Output is correct |
63 |
Correct |
199 ms |
124212 KB |
Output is correct |
64 |
Correct |
198 ms |
124292 KB |
Output is correct |
65 |
Correct |
112 ms |
119480 KB |
Output is correct |
66 |
Correct |
126 ms |
119356 KB |
Output is correct |
67 |
Correct |
175 ms |
118120 KB |
Output is correct |
68 |
Correct |
164 ms |
122492 KB |
Output is correct |
69 |
Correct |
165 ms |
122536 KB |
Output is correct |
70 |
Correct |
172 ms |
124312 KB |
Output is correct |
71 |
Correct |
170 ms |
124348 KB |
Output is correct |
72 |
Correct |
196 ms |
124324 KB |
Output is correct |
73 |
Correct |
182 ms |
124360 KB |
Output is correct |
74 |
Correct |
120 ms |
119488 KB |
Output is correct |
75 |
Correct |
112 ms |
119540 KB |
Output is correct |
76 |
Correct |
124 ms |
119324 KB |
Output is correct |
77 |
Correct |
114 ms |
119376 KB |
Output is correct |
78 |
Correct |
866 ms |
121516 KB |
Output is correct |
79 |
Correct |
1149 ms |
122556 KB |
Output is correct |
80 |
Correct |
1069 ms |
122476 KB |
Output is correct |
81 |
Correct |
1039 ms |
124288 KB |
Output is correct |
82 |
Correct |
1092 ms |
124388 KB |
Output is correct |
83 |
Correct |
1039 ms |
124332 KB |
Output is correct |
84 |
Correct |
1091 ms |
124240 KB |
Output is correct |
85 |
Correct |
1157 ms |
119404 KB |
Output is correct |
86 |
Correct |
1104 ms |
119424 KB |
Output is correct |
87 |
Correct |
1099 ms |
119228 KB |
Output is correct |
88 |
Correct |
1097 ms |
119216 KB |
Output is correct |
89 |
Correct |
1126 ms |
119484 KB |
Output is correct |
90 |
Correct |
1149 ms |
119324 KB |
Output is correct |
91 |
Correct |
1 ms |
344 KB |
Output is correct |
92 |
Correct |
4 ms |
2136 KB |
Output is correct |
93 |
Correct |
2 ms |
2136 KB |
Output is correct |
94 |
Correct |
167 ms |
122656 KB |
Output is correct |
95 |
Correct |
185 ms |
124392 KB |
Output is correct |
96 |
Correct |
179 ms |
124304 KB |
Output is correct |
97 |
Correct |
130 ms |
119400 KB |
Output is correct |
98 |
Correct |
121 ms |
119504 KB |
Output is correct |
99 |
Correct |
194 ms |
122448 KB |
Output is correct |
100 |
Correct |
196 ms |
124440 KB |
Output is correct |
101 |
Correct |
185 ms |
124280 KB |
Output is correct |
102 |
Correct |
129 ms |
119280 KB |
Output is correct |
103 |
Correct |
122 ms |
119104 KB |
Output is correct |
104 |
Correct |
3 ms |
2136 KB |
Output is correct |
105 |
Correct |
3 ms |
2136 KB |
Output is correct |
106 |
Correct |
3 ms |
2136 KB |
Output is correct |
107 |
Correct |
2 ms |
2136 KB |
Output is correct |
108 |
Correct |
2 ms |
2136 KB |
Output is correct |
109 |
Correct |
2 ms |
2136 KB |
Output is correct |
110 |
Correct |
3 ms |
2136 KB |
Output is correct |
111 |
Correct |
3 ms |
2136 KB |
Output is correct |
112 |
Correct |
2 ms |
2136 KB |
Output is correct |
113 |
Correct |
2 ms |
2136 KB |
Output is correct |
114 |
Correct |
206 ms |
27288 KB |
Output is correct |
115 |
Correct |
840 ms |
122740 KB |
Output is correct |
116 |
Correct |
887 ms |
122476 KB |
Output is correct |
117 |
Correct |
856 ms |
124376 KB |
Output is correct |
118 |
Correct |
867 ms |
124328 KB |
Output is correct |
119 |
Correct |
930 ms |
124292 KB |
Output is correct |
120 |
Correct |
875 ms |
124348 KB |
Output is correct |
121 |
Correct |
648 ms |
119516 KB |
Output is correct |
122 |
Correct |
672 ms |
119480 KB |
Output is correct |
123 |
Correct |
704 ms |
119228 KB |
Output is correct |
124 |
Correct |
771 ms |
119352 KB |
Output is correct |
125 |
Correct |
176 ms |
122600 KB |
Output is correct |
126 |
Correct |
194 ms |
124332 KB |
Output is correct |
127 |
Correct |
185 ms |
124332 KB |
Output is correct |
128 |
Correct |
120 ms |
119476 KB |
Output is correct |
129 |
Correct |
117 ms |
119240 KB |
Output is correct |
130 |
Correct |
161 ms |
118184 KB |
Output is correct |
131 |
Correct |
166 ms |
122644 KB |
Output is correct |
132 |
Correct |
188 ms |
122528 KB |
Output is correct |
133 |
Correct |
167 ms |
124328 KB |
Output is correct |
134 |
Correct |
188 ms |
124584 KB |
Output is correct |
135 |
Correct |
179 ms |
124336 KB |
Output is correct |
136 |
Correct |
177 ms |
124204 KB |
Output is correct |
137 |
Correct |
120 ms |
119492 KB |
Output is correct |
138 |
Correct |
119 ms |
119492 KB |
Output is correct |
139 |
Correct |
118 ms |
119236 KB |
Output is correct |
140 |
Correct |
121 ms |
119476 KB |
Output is correct |
141 |
Correct |
2 ms |
2136 KB |
Output is correct |
142 |
Correct |
3 ms |
2136 KB |
Output is correct |
143 |
Correct |
3 ms |
2388 KB |
Output is correct |
144 |
Correct |
2 ms |
2332 KB |
Output is correct |
145 |
Correct |
2 ms |
2220 KB |
Output is correct |
146 |
Correct |
1 ms |
1112 KB |
Output is correct |
147 |
Correct |
3 ms |
2200 KB |
Output is correct |
148 |
Correct |
3 ms |
2136 KB |
Output is correct |
149 |
Correct |
3 ms |
2136 KB |
Output is correct |
150 |
Correct |
4 ms |
2136 KB |
Output is correct |
151 |
Correct |
3 ms |
2136 KB |
Output is correct |
152 |
Correct |
3 ms |
2136 KB |
Output is correct |
153 |
Correct |
4 ms |
2136 KB |
Output is correct |
154 |
Correct |
3 ms |
2136 KB |
Output is correct |
155 |
Correct |
3 ms |
2136 KB |
Output is correct |
156 |
Correct |
2 ms |
2136 KB |
Output is correct |
157 |
Correct |
951 ms |
108236 KB |
Output is correct |
158 |
Correct |
1064 ms |
122624 KB |
Output is correct |
159 |
Correct |
1078 ms |
122552 KB |
Output is correct |
160 |
Correct |
1176 ms |
124520 KB |
Output is correct |
161 |
Correct |
1176 ms |
124456 KB |
Output is correct |
162 |
Correct |
1204 ms |
124292 KB |
Output is correct |
163 |
Correct |
1090 ms |
124352 KB |
Output is correct |
164 |
Correct |
1112 ms |
119364 KB |
Output is correct |
165 |
Correct |
1143 ms |
119476 KB |
Output is correct |
166 |
Correct |
1079 ms |
119316 KB |
Output is correct |
167 |
Correct |
1092 ms |
119480 KB |
Output is correct |
168 |
Correct |
1 ms |
344 KB |
Output is correct |
169 |
Correct |
723 ms |
40084 KB |
Output is correct |
170 |
Correct |
1550 ms |
122536 KB |
Output is correct |
171 |
Correct |
1481 ms |
122552 KB |
Output is correct |
172 |
Correct |
1485 ms |
124268 KB |
Output is correct |
173 |
Correct |
1562 ms |
124200 KB |
Output is correct |
174 |
Correct |
1506 ms |
124348 KB |
Output is correct |
175 |
Correct |
1389 ms |
124340 KB |
Output is correct |
176 |
Correct |
1170 ms |
119320 KB |
Output is correct |
177 |
Correct |
1155 ms |
119480 KB |
Output is correct |
178 |
Correct |
1066 ms |
119488 KB |
Output is correct |
179 |
Correct |
1111 ms |
119112 KB |
Output is correct |