#include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
const ll big = 1000000007;
const int MAXN = 100001;
int n;
vi H2;
template<class T>
struct RMQ {
vector<vector<T>> jmp;
RMQ() {}
RMQ(const vector<T>& V) : jmp(1, V) {
for (int pw = 1, k = 1; pw * 2 <= sz(V); pw *= 2, ++k) {
jmp.emplace_back(sz(V) - pw * 2 + 1);
rep(j,0,sz(jmp[k]))
jmp[k][j] = min(jmp[k - 1][j], jmp[k - 1][j + pw]);
}
}
T query(int a, int b) {
//assert(a < b); // or return inf if a == b
if(a >= b)return big;
int dep = 31 - __builtin_clz(b - a);
return min(jmp[dep][a], jmp[dep][b - (1 << dep)]);
}
};
RMQ<int> min_rmq, max_rmq;
int get_min2(int L, int R){
return min_rmq.query(L, R);
}
int get_max2(int L, int R){
return -max_rmq.query(L, R);
}
struct Segtree {
Segtree *l = 0, *r = 0;
int lo, hi, ma = -big, mi = big, ab = 0, ba = 0;
vi V = {};
Segtree(vi& v, int lo, int hi) : lo(lo), hi(hi) {
if (lo + 1 < hi) {
int mid = lo + (hi - lo)/2;
l = new Segtree(v, lo, mid); r = new Segtree(v, mid, hi);
ma = max(l->ma, r->ma);
mi = min(l->mi, r->mi);
ab = max(l->ab, r->ab);
ab = max(ab, (r->ma) - (l->mi));
ba = max(l->ba, r->ba);
ba = max(ba, (l->ma) - (r->mi));
}
else{
ma = v[lo];
mi = v[lo];
}
}
void setup(vi &v){
if(lo + 1 < hi){
l->setup(v);
r->setup(v);
int x = 0;
int y = 0;
while(x < sz(l->V) || y < sz(r->V)){
if(y == sz(r->V) || (x < sz(l->V) && l->V[x] >= r->V[y])){
V.push_back(l->V[x]);
x++;
}
else{
V.push_back(r->V[y]);
y++;
}
}
}
else{
if(v[lo] > 0){V = {v[lo]};}
}
}
int get_max(int L, int R) {
if (R <= lo || hi <= L) return -big;
if (L <= lo && hi <= R) return ma;
return get_max2(L, R);
}
int get_min(int L, int R) {
if (R <= lo || hi <= L) return big;
if (L <= lo && hi <= R) return mi;
return get_min2(L, R);
}
int get_ab(int L, int R){
if (R <= lo || hi <= L) return 0;
if (L <= lo && hi <= R) return ab;
int x = l->get_min(L,R);
int y = r->get_max(L,R);
int res = y-x;
if(res < r->ab){
res = max(res, r->get_ab(L, R));
}
if(res < l->ab){
res = max(res, l->get_ab(L, R));
}
return res;
}
int get_ba(int L, int R){
if (R <= lo || hi <= L) return 0;
if (L <= lo && hi <= R) return ba;
int x = r->get_min(L,R);
int y = l->get_max(L,R);
int res = y-x;
if(res < r->ba){
res = max(res, r->get_ba(L, R));
}
if(res < l->ba){
res = max(res, l->get_ba(L, R));
}
return res;
}
int geq(int L, int R, int D){
if (R <= lo || hi <= L) return 0;
if (L <= lo && hi <= R){
int lo = 0;
int hi = sz(V);
if(sz(V) == 0)return 0;
if(V[0] < D)return 0;
while(lo < hi-1){
int mid = (lo + hi) / 2;
if(V[mid] < D){
hi = mid;
}
else{
lo = mid;
}
}
return hi;
}
return (l->geq(L, R, D)) + (r->geq(L, R, D));
}
};
Segtree *ST;
map<int,int> HI;
vi delta;
vi ind;
void get_ct(int L, int R){
if(L >= R)return;
if(L == R-1){
delta[L] = 0;
return;
}
int i = HI[ST->get_max(L, R)];
int x = ST->get_min(L,i);
int y = ST->get_min(i+1,R);
delta[i] = H2[i]-max(x, y);
delta[i] = max(delta[i], 0);
get_ct(L, i);
get_ct(i+1,R);
}
bool comp(int i, int j){
return delta[i] > delta[j];
}
void init(int N, vi H){
n = N;
vi H3;
rep(c1,0,n){
H2.push_back(H[c1]);
HI[H[c1]] = c1;
H3.push_back(-H[c1]);
ind.push_back(c1);
delta.push_back(0);
}
ST = new Segtree(H2, 0, n);
min_rmq = RMQ<int>(H2);
max_rmq = RMQ<int>(H3);
get_ct(0, n);
sort(all(ind), comp);
ST->setup(delta);
}
//unordered_map<ll,int> M;
const int lim = 10;
int AB(int L, int R){
if(R-L > lim)return ST->get_ab(L,R);
int mi = big;
int res = 0;
rep(c1,L,R){
mi = min(mi, H2[c1]);
res = max(H2[c1]-mi, res);
}
return res;
}
int BA(int L, int R){
if(R-L > lim)return ST->get_ba(L, R);
int ma = -big;
int res = 0;
rep(c1,L,R){
ma = max(ma, H2[c1]);
res = max(ma-H2[c1], res);
}
return res;
}
int first_ab(ll L, ll R, ll D){
// ll h = 2*(L*big + D);
// if(M.find(h) != M.end())return M[h];
int lo = L;
int hi = R;
while(lo < hi-1){
int mid = (lo+hi)/2;
if(AB(L, mid+1) < D){
lo = mid;
}
else{
hi = mid;
}
}
// M[h] = hi;
return hi;
}
int last_ba(ll L, ll R, ll D){
// ll h = 2*(R*big + D) + 1;
// if(M.find(h) != M.end())return M[h];
int lo = L;
int hi = R;
while(lo < hi-1){
int mid = (lo+hi)/2;
if(BA(mid, R) >= D){
lo = mid;
}
else{
hi = mid;
}
}
// M[h] = lo;
return lo;
}
int max_towers(int L, int R, int D){
R++;
if(ST->get_ab(L, R) < D || ST->get_ba(L, R) < D)return 1;
int i = first_ab(L, R, D);
int j = last_ba(L, R, D)+1;
return (ST->geq(i,j,D))+1;
}
/*
int main() {
int N;
N = 7;
vi H = {1,4,2,9,3,6,5};
init(N,H);
cout << max_towers(0, 6, 1) << "\n";
cout << max_towers(0, 6, 2) << "\n";
cout << max_towers(0, 6, 3) << "\n";
cout << max_towers(0, 6, 10) << "\n";
return 0;
}
*/
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
529 ms |
24672 KB |
Output is correct |
2 |
Correct |
1031 ms |
42644 KB |
Output is correct |
3 |
Correct |
953 ms |
42776 KB |
Output is correct |
4 |
Correct |
987 ms |
43036 KB |
Output is correct |
5 |
Correct |
1053 ms |
35324 KB |
Output is correct |
6 |
Correct |
1433 ms |
43096 KB |
Output is correct |
7 |
Correct |
1252 ms |
35284 KB |
Output is correct |
8 |
Correct |
0 ms |
208 KB |
Output is correct |
9 |
Correct |
1 ms |
824 KB |
Output is correct |
10 |
Correct |
1 ms |
848 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
336 KB |
Output is correct |
2 |
Correct |
2 ms |
976 KB |
Output is correct |
3 |
Correct |
2 ms |
976 KB |
Output is correct |
4 |
Correct |
2 ms |
976 KB |
Output is correct |
5 |
Correct |
2 ms |
976 KB |
Output is correct |
6 |
Correct |
2 ms |
1104 KB |
Output is correct |
7 |
Correct |
3 ms |
976 KB |
Output is correct |
8 |
Correct |
2 ms |
976 KB |
Output is correct |
9 |
Correct |
1 ms |
848 KB |
Output is correct |
10 |
Correct |
2 ms |
976 KB |
Output is correct |
11 |
Correct |
1 ms |
848 KB |
Output is correct |
12 |
Correct |
0 ms |
208 KB |
Output is correct |
13 |
Correct |
2 ms |
848 KB |
Output is correct |
14 |
Correct |
1 ms |
848 KB |
Output is correct |
15 |
Correct |
3 ms |
976 KB |
Output is correct |
16 |
Correct |
3 ms |
976 KB |
Output is correct |
17 |
Correct |
2 ms |
976 KB |
Output is correct |
18 |
Correct |
2 ms |
848 KB |
Output is correct |
19 |
Correct |
1 ms |
976 KB |
Output is correct |
20 |
Correct |
2 ms |
976 KB |
Output is correct |
21 |
Correct |
2 ms |
976 KB |
Output is correct |
22 |
Correct |
3 ms |
976 KB |
Output is correct |
23 |
Correct |
1 ms |
848 KB |
Output is correct |
24 |
Correct |
1 ms |
940 KB |
Output is correct |
25 |
Correct |
1 ms |
592 KB |
Output is correct |
26 |
Correct |
2 ms |
976 KB |
Output is correct |
27 |
Correct |
2 ms |
976 KB |
Output is correct |
28 |
Correct |
2 ms |
976 KB |
Output is correct |
29 |
Correct |
2 ms |
976 KB |
Output is correct |
30 |
Correct |
2 ms |
976 KB |
Output is correct |
31 |
Correct |
2 ms |
976 KB |
Output is correct |
32 |
Correct |
2 ms |
976 KB |
Output is correct |
33 |
Correct |
2 ms |
848 KB |
Output is correct |
34 |
Correct |
2 ms |
976 KB |
Output is correct |
35 |
Correct |
2 ms |
848 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
336 KB |
Output is correct |
2 |
Correct |
2 ms |
976 KB |
Output is correct |
3 |
Correct |
2 ms |
976 KB |
Output is correct |
4 |
Correct |
2 ms |
976 KB |
Output is correct |
5 |
Correct |
2 ms |
976 KB |
Output is correct |
6 |
Correct |
2 ms |
1104 KB |
Output is correct |
7 |
Correct |
3 ms |
976 KB |
Output is correct |
8 |
Correct |
2 ms |
976 KB |
Output is correct |
9 |
Correct |
1 ms |
848 KB |
Output is correct |
10 |
Correct |
2 ms |
976 KB |
Output is correct |
11 |
Correct |
1 ms |
848 KB |
Output is correct |
12 |
Correct |
0 ms |
208 KB |
Output is correct |
13 |
Correct |
2 ms |
848 KB |
Output is correct |
14 |
Correct |
1 ms |
848 KB |
Output is correct |
15 |
Correct |
3 ms |
976 KB |
Output is correct |
16 |
Correct |
3 ms |
976 KB |
Output is correct |
17 |
Correct |
2 ms |
976 KB |
Output is correct |
18 |
Correct |
2 ms |
848 KB |
Output is correct |
19 |
Correct |
1 ms |
976 KB |
Output is correct |
20 |
Correct |
2 ms |
976 KB |
Output is correct |
21 |
Correct |
2 ms |
976 KB |
Output is correct |
22 |
Correct |
3 ms |
976 KB |
Output is correct |
23 |
Correct |
1 ms |
848 KB |
Output is correct |
24 |
Correct |
1 ms |
940 KB |
Output is correct |
25 |
Correct |
1 ms |
592 KB |
Output is correct |
26 |
Correct |
2 ms |
976 KB |
Output is correct |
27 |
Correct |
2 ms |
976 KB |
Output is correct |
28 |
Correct |
2 ms |
976 KB |
Output is correct |
29 |
Correct |
2 ms |
976 KB |
Output is correct |
30 |
Correct |
2 ms |
976 KB |
Output is correct |
31 |
Correct |
2 ms |
976 KB |
Output is correct |
32 |
Correct |
2 ms |
976 KB |
Output is correct |
33 |
Correct |
2 ms |
848 KB |
Output is correct |
34 |
Correct |
2 ms |
976 KB |
Output is correct |
35 |
Correct |
2 ms |
848 KB |
Output is correct |
36 |
Correct |
78 ms |
26564 KB |
Output is correct |
37 |
Correct |
121 ms |
41624 KB |
Output is correct |
38 |
Correct |
133 ms |
41476 KB |
Output is correct |
39 |
Correct |
122 ms |
43424 KB |
Output is correct |
40 |
Correct |
131 ms |
43328 KB |
Output is correct |
41 |
Correct |
128 ms |
43308 KB |
Output is correct |
42 |
Correct |
120 ms |
43400 KB |
Output is correct |
43 |
Correct |
73 ms |
43120 KB |
Output is correct |
44 |
Correct |
62 ms |
35204 KB |
Output is correct |
45 |
Correct |
62 ms |
41028 KB |
Output is correct |
46 |
Correct |
58 ms |
35328 KB |
Output is correct |
47 |
Correct |
132 ms |
41524 KB |
Output is correct |
48 |
Correct |
111 ms |
43412 KB |
Output is correct |
49 |
Correct |
108 ms |
43404 KB |
Output is correct |
50 |
Correct |
71 ms |
35220 KB |
Output is correct |
51 |
Correct |
72 ms |
42884 KB |
Output is correct |
52 |
Correct |
112 ms |
41576 KB |
Output is correct |
53 |
Correct |
108 ms |
43308 KB |
Output is correct |
54 |
Correct |
117 ms |
43436 KB |
Output is correct |
55 |
Correct |
63 ms |
35276 KB |
Output is correct |
56 |
Correct |
66 ms |
42416 KB |
Output is correct |
57 |
Correct |
100 ms |
39560 KB |
Output is correct |
58 |
Correct |
104 ms |
41564 KB |
Output is correct |
59 |
Correct |
106 ms |
41644 KB |
Output is correct |
60 |
Correct |
105 ms |
43428 KB |
Output is correct |
61 |
Correct |
117 ms |
43380 KB |
Output is correct |
62 |
Correct |
115 ms |
43456 KB |
Output is correct |
63 |
Correct |
104 ms |
43308 KB |
Output is correct |
64 |
Correct |
62 ms |
43092 KB |
Output is correct |
65 |
Correct |
66 ms |
35300 KB |
Output is correct |
66 |
Correct |
64 ms |
40064 KB |
Output is correct |
67 |
Correct |
60 ms |
35332 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1423 ms |
41192 KB |
Output is correct |
2 |
Correct |
2027 ms |
41648 KB |
Output is correct |
3 |
Correct |
1927 ms |
41616 KB |
Output is correct |
4 |
Correct |
1979 ms |
43352 KB |
Output is correct |
5 |
Correct |
1830 ms |
43388 KB |
Output is correct |
6 |
Correct |
1884 ms |
43408 KB |
Output is correct |
7 |
Correct |
1901 ms |
43356 KB |
Output is correct |
8 |
Correct |
1336 ms |
43132 KB |
Output is correct |
9 |
Correct |
1211 ms |
35220 KB |
Output is correct |
10 |
Correct |
1367 ms |
41108 KB |
Output is correct |
11 |
Correct |
1410 ms |
35244 KB |
Output is correct |
12 |
Correct |
1336 ms |
43052 KB |
Output is correct |
13 |
Correct |
1124 ms |
35320 KB |
Output is correct |
14 |
Correct |
0 ms |
208 KB |
Output is correct |
15 |
Correct |
2 ms |
848 KB |
Output is correct |
16 |
Correct |
1 ms |
848 KB |
Output is correct |
17 |
Correct |
106 ms |
41536 KB |
Output is correct |
18 |
Correct |
115 ms |
43436 KB |
Output is correct |
19 |
Correct |
113 ms |
43420 KB |
Output is correct |
20 |
Correct |
62 ms |
35360 KB |
Output is correct |
21 |
Correct |
63 ms |
42884 KB |
Output is correct |
22 |
Correct |
105 ms |
41596 KB |
Output is correct |
23 |
Correct |
108 ms |
43372 KB |
Output is correct |
24 |
Correct |
112 ms |
43324 KB |
Output is correct |
25 |
Correct |
66 ms |
35364 KB |
Output is correct |
26 |
Correct |
63 ms |
42400 KB |
Output is correct |
27 |
Correct |
3 ms |
976 KB |
Output is correct |
28 |
Correct |
2 ms |
976 KB |
Output is correct |
29 |
Correct |
2 ms |
976 KB |
Output is correct |
30 |
Correct |
1 ms |
848 KB |
Output is correct |
31 |
Correct |
1 ms |
976 KB |
Output is correct |
32 |
Correct |
2 ms |
976 KB |
Output is correct |
33 |
Correct |
2 ms |
976 KB |
Output is correct |
34 |
Correct |
2 ms |
976 KB |
Output is correct |
35 |
Correct |
1 ms |
848 KB |
Output is correct |
36 |
Correct |
1 ms |
976 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
390 ms |
9544 KB |
Output is correct |
2 |
Correct |
1635 ms |
41620 KB |
Output is correct |
3 |
Correct |
1395 ms |
41600 KB |
Output is correct |
4 |
Correct |
1332 ms |
43404 KB |
Output is correct |
5 |
Correct |
1372 ms |
43324 KB |
Output is correct |
6 |
Correct |
1504 ms |
43432 KB |
Output is correct |
7 |
Correct |
1525 ms |
43392 KB |
Output is correct |
8 |
Correct |
924 ms |
43088 KB |
Output is correct |
9 |
Correct |
949 ms |
35328 KB |
Output is correct |
10 |
Correct |
1138 ms |
39924 KB |
Output is correct |
11 |
Correct |
1373 ms |
35268 KB |
Output is correct |
12 |
Correct |
119 ms |
41600 KB |
Output is correct |
13 |
Correct |
127 ms |
43376 KB |
Output is correct |
14 |
Correct |
106 ms |
43436 KB |
Output is correct |
15 |
Correct |
60 ms |
35292 KB |
Output is correct |
16 |
Correct |
65 ms |
42388 KB |
Output is correct |
17 |
Correct |
115 ms |
39620 KB |
Output is correct |
18 |
Correct |
130 ms |
41596 KB |
Output is correct |
19 |
Correct |
109 ms |
41616 KB |
Output is correct |
20 |
Correct |
127 ms |
43432 KB |
Output is correct |
21 |
Correct |
137 ms |
43404 KB |
Output is correct |
22 |
Correct |
106 ms |
43392 KB |
Output is correct |
23 |
Correct |
134 ms |
43388 KB |
Output is correct |
24 |
Correct |
66 ms |
43040 KB |
Output is correct |
25 |
Correct |
60 ms |
35328 KB |
Output is correct |
26 |
Correct |
67 ms |
40108 KB |
Output is correct |
27 |
Correct |
84 ms |
35344 KB |
Output is correct |
28 |
Correct |
2 ms |
976 KB |
Output is correct |
29 |
Correct |
2 ms |
912 KB |
Output is correct |
30 |
Correct |
2 ms |
976 KB |
Output is correct |
31 |
Correct |
1 ms |
848 KB |
Output is correct |
32 |
Correct |
2 ms |
976 KB |
Output is correct |
33 |
Correct |
1 ms |
592 KB |
Output is correct |
34 |
Correct |
2 ms |
976 KB |
Output is correct |
35 |
Correct |
2 ms |
976 KB |
Output is correct |
36 |
Correct |
2 ms |
976 KB |
Output is correct |
37 |
Correct |
2 ms |
976 KB |
Output is correct |
38 |
Correct |
2 ms |
976 KB |
Output is correct |
39 |
Correct |
2 ms |
976 KB |
Output is correct |
40 |
Correct |
2 ms |
976 KB |
Output is correct |
41 |
Correct |
1 ms |
848 KB |
Output is correct |
42 |
Correct |
2 ms |
976 KB |
Output is correct |
43 |
Correct |
2 ms |
848 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
336 KB |
Output is correct |
2 |
Correct |
2 ms |
976 KB |
Output is correct |
3 |
Correct |
2 ms |
976 KB |
Output is correct |
4 |
Correct |
2 ms |
976 KB |
Output is correct |
5 |
Correct |
2 ms |
976 KB |
Output is correct |
6 |
Correct |
2 ms |
1104 KB |
Output is correct |
7 |
Correct |
3 ms |
976 KB |
Output is correct |
8 |
Correct |
2 ms |
976 KB |
Output is correct |
9 |
Correct |
1 ms |
848 KB |
Output is correct |
10 |
Correct |
2 ms |
976 KB |
Output is correct |
11 |
Correct |
1 ms |
848 KB |
Output is correct |
12 |
Correct |
0 ms |
208 KB |
Output is correct |
13 |
Correct |
2 ms |
848 KB |
Output is correct |
14 |
Correct |
1 ms |
848 KB |
Output is correct |
15 |
Correct |
3 ms |
976 KB |
Output is correct |
16 |
Correct |
3 ms |
976 KB |
Output is correct |
17 |
Correct |
2 ms |
976 KB |
Output is correct |
18 |
Correct |
2 ms |
848 KB |
Output is correct |
19 |
Correct |
1 ms |
976 KB |
Output is correct |
20 |
Correct |
2 ms |
976 KB |
Output is correct |
21 |
Correct |
2 ms |
976 KB |
Output is correct |
22 |
Correct |
3 ms |
976 KB |
Output is correct |
23 |
Correct |
1 ms |
848 KB |
Output is correct |
24 |
Correct |
1 ms |
940 KB |
Output is correct |
25 |
Correct |
1 ms |
592 KB |
Output is correct |
26 |
Correct |
2 ms |
976 KB |
Output is correct |
27 |
Correct |
2 ms |
976 KB |
Output is correct |
28 |
Correct |
2 ms |
976 KB |
Output is correct |
29 |
Correct |
2 ms |
976 KB |
Output is correct |
30 |
Correct |
2 ms |
976 KB |
Output is correct |
31 |
Correct |
2 ms |
976 KB |
Output is correct |
32 |
Correct |
2 ms |
976 KB |
Output is correct |
33 |
Correct |
2 ms |
848 KB |
Output is correct |
34 |
Correct |
2 ms |
976 KB |
Output is correct |
35 |
Correct |
2 ms |
848 KB |
Output is correct |
36 |
Correct |
78 ms |
26564 KB |
Output is correct |
37 |
Correct |
121 ms |
41624 KB |
Output is correct |
38 |
Correct |
133 ms |
41476 KB |
Output is correct |
39 |
Correct |
122 ms |
43424 KB |
Output is correct |
40 |
Correct |
131 ms |
43328 KB |
Output is correct |
41 |
Correct |
128 ms |
43308 KB |
Output is correct |
42 |
Correct |
120 ms |
43400 KB |
Output is correct |
43 |
Correct |
73 ms |
43120 KB |
Output is correct |
44 |
Correct |
62 ms |
35204 KB |
Output is correct |
45 |
Correct |
62 ms |
41028 KB |
Output is correct |
46 |
Correct |
58 ms |
35328 KB |
Output is correct |
47 |
Correct |
132 ms |
41524 KB |
Output is correct |
48 |
Correct |
111 ms |
43412 KB |
Output is correct |
49 |
Correct |
108 ms |
43404 KB |
Output is correct |
50 |
Correct |
71 ms |
35220 KB |
Output is correct |
51 |
Correct |
72 ms |
42884 KB |
Output is correct |
52 |
Correct |
112 ms |
41576 KB |
Output is correct |
53 |
Correct |
108 ms |
43308 KB |
Output is correct |
54 |
Correct |
117 ms |
43436 KB |
Output is correct |
55 |
Correct |
63 ms |
35276 KB |
Output is correct |
56 |
Correct |
66 ms |
42416 KB |
Output is correct |
57 |
Correct |
100 ms |
39560 KB |
Output is correct |
58 |
Correct |
104 ms |
41564 KB |
Output is correct |
59 |
Correct |
106 ms |
41644 KB |
Output is correct |
60 |
Correct |
105 ms |
43428 KB |
Output is correct |
61 |
Correct |
117 ms |
43380 KB |
Output is correct |
62 |
Correct |
115 ms |
43456 KB |
Output is correct |
63 |
Correct |
104 ms |
43308 KB |
Output is correct |
64 |
Correct |
62 ms |
43092 KB |
Output is correct |
65 |
Correct |
66 ms |
35300 KB |
Output is correct |
66 |
Correct |
64 ms |
40064 KB |
Output is correct |
67 |
Correct |
60 ms |
35332 KB |
Output is correct |
68 |
Correct |
1423 ms |
41192 KB |
Output is correct |
69 |
Correct |
2027 ms |
41648 KB |
Output is correct |
70 |
Correct |
1927 ms |
41616 KB |
Output is correct |
71 |
Correct |
1979 ms |
43352 KB |
Output is correct |
72 |
Correct |
1830 ms |
43388 KB |
Output is correct |
73 |
Correct |
1884 ms |
43408 KB |
Output is correct |
74 |
Correct |
1901 ms |
43356 KB |
Output is correct |
75 |
Correct |
1336 ms |
43132 KB |
Output is correct |
76 |
Correct |
1211 ms |
35220 KB |
Output is correct |
77 |
Correct |
1367 ms |
41108 KB |
Output is correct |
78 |
Correct |
1410 ms |
35244 KB |
Output is correct |
79 |
Correct |
1336 ms |
43052 KB |
Output is correct |
80 |
Correct |
1124 ms |
35320 KB |
Output is correct |
81 |
Correct |
0 ms |
208 KB |
Output is correct |
82 |
Correct |
2 ms |
848 KB |
Output is correct |
83 |
Correct |
1 ms |
848 KB |
Output is correct |
84 |
Correct |
106 ms |
41536 KB |
Output is correct |
85 |
Correct |
115 ms |
43436 KB |
Output is correct |
86 |
Correct |
113 ms |
43420 KB |
Output is correct |
87 |
Correct |
62 ms |
35360 KB |
Output is correct |
88 |
Correct |
63 ms |
42884 KB |
Output is correct |
89 |
Correct |
105 ms |
41596 KB |
Output is correct |
90 |
Correct |
108 ms |
43372 KB |
Output is correct |
91 |
Correct |
112 ms |
43324 KB |
Output is correct |
92 |
Correct |
66 ms |
35364 KB |
Output is correct |
93 |
Correct |
63 ms |
42400 KB |
Output is correct |
94 |
Correct |
3 ms |
976 KB |
Output is correct |
95 |
Correct |
2 ms |
976 KB |
Output is correct |
96 |
Correct |
2 ms |
976 KB |
Output is correct |
97 |
Correct |
1 ms |
848 KB |
Output is correct |
98 |
Correct |
1 ms |
976 KB |
Output is correct |
99 |
Correct |
2 ms |
976 KB |
Output is correct |
100 |
Correct |
2 ms |
976 KB |
Output is correct |
101 |
Correct |
2 ms |
976 KB |
Output is correct |
102 |
Correct |
1 ms |
848 KB |
Output is correct |
103 |
Correct |
1 ms |
976 KB |
Output is correct |
104 |
Correct |
1787 ms |
36172 KB |
Output is correct |
105 |
Correct |
2057 ms |
41484 KB |
Output is correct |
106 |
Correct |
2146 ms |
41620 KB |
Output is correct |
107 |
Correct |
2065 ms |
43420 KB |
Output is correct |
108 |
Correct |
1810 ms |
43436 KB |
Output is correct |
109 |
Correct |
1886 ms |
43392 KB |
Output is correct |
110 |
Correct |
2054 ms |
43408 KB |
Output is correct |
111 |
Correct |
945 ms |
43136 KB |
Output is correct |
112 |
Correct |
930 ms |
35332 KB |
Output is correct |
113 |
Correct |
1064 ms |
41448 KB |
Output is correct |
114 |
Correct |
1130 ms |
35236 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
529 ms |
24672 KB |
Output is correct |
2 |
Correct |
1031 ms |
42644 KB |
Output is correct |
3 |
Correct |
953 ms |
42776 KB |
Output is correct |
4 |
Correct |
987 ms |
43036 KB |
Output is correct |
5 |
Correct |
1053 ms |
35324 KB |
Output is correct |
6 |
Correct |
1433 ms |
43096 KB |
Output is correct |
7 |
Correct |
1252 ms |
35284 KB |
Output is correct |
8 |
Correct |
0 ms |
208 KB |
Output is correct |
9 |
Correct |
1 ms |
824 KB |
Output is correct |
10 |
Correct |
1 ms |
848 KB |
Output is correct |
11 |
Correct |
1 ms |
336 KB |
Output is correct |
12 |
Correct |
2 ms |
976 KB |
Output is correct |
13 |
Correct |
2 ms |
976 KB |
Output is correct |
14 |
Correct |
2 ms |
976 KB |
Output is correct |
15 |
Correct |
2 ms |
976 KB |
Output is correct |
16 |
Correct |
2 ms |
1104 KB |
Output is correct |
17 |
Correct |
3 ms |
976 KB |
Output is correct |
18 |
Correct |
2 ms |
976 KB |
Output is correct |
19 |
Correct |
1 ms |
848 KB |
Output is correct |
20 |
Correct |
2 ms |
976 KB |
Output is correct |
21 |
Correct |
1 ms |
848 KB |
Output is correct |
22 |
Correct |
0 ms |
208 KB |
Output is correct |
23 |
Correct |
2 ms |
848 KB |
Output is correct |
24 |
Correct |
1 ms |
848 KB |
Output is correct |
25 |
Correct |
3 ms |
976 KB |
Output is correct |
26 |
Correct |
3 ms |
976 KB |
Output is correct |
27 |
Correct |
2 ms |
976 KB |
Output is correct |
28 |
Correct |
2 ms |
848 KB |
Output is correct |
29 |
Correct |
1 ms |
976 KB |
Output is correct |
30 |
Correct |
2 ms |
976 KB |
Output is correct |
31 |
Correct |
2 ms |
976 KB |
Output is correct |
32 |
Correct |
3 ms |
976 KB |
Output is correct |
33 |
Correct |
1 ms |
848 KB |
Output is correct |
34 |
Correct |
1 ms |
940 KB |
Output is correct |
35 |
Correct |
1 ms |
592 KB |
Output is correct |
36 |
Correct |
2 ms |
976 KB |
Output is correct |
37 |
Correct |
2 ms |
976 KB |
Output is correct |
38 |
Correct |
2 ms |
976 KB |
Output is correct |
39 |
Correct |
2 ms |
976 KB |
Output is correct |
40 |
Correct |
2 ms |
976 KB |
Output is correct |
41 |
Correct |
2 ms |
976 KB |
Output is correct |
42 |
Correct |
2 ms |
976 KB |
Output is correct |
43 |
Correct |
2 ms |
848 KB |
Output is correct |
44 |
Correct |
2 ms |
976 KB |
Output is correct |
45 |
Correct |
2 ms |
848 KB |
Output is correct |
46 |
Correct |
78 ms |
26564 KB |
Output is correct |
47 |
Correct |
121 ms |
41624 KB |
Output is correct |
48 |
Correct |
133 ms |
41476 KB |
Output is correct |
49 |
Correct |
122 ms |
43424 KB |
Output is correct |
50 |
Correct |
131 ms |
43328 KB |
Output is correct |
51 |
Correct |
128 ms |
43308 KB |
Output is correct |
52 |
Correct |
120 ms |
43400 KB |
Output is correct |
53 |
Correct |
73 ms |
43120 KB |
Output is correct |
54 |
Correct |
62 ms |
35204 KB |
Output is correct |
55 |
Correct |
62 ms |
41028 KB |
Output is correct |
56 |
Correct |
58 ms |
35328 KB |
Output is correct |
57 |
Correct |
132 ms |
41524 KB |
Output is correct |
58 |
Correct |
111 ms |
43412 KB |
Output is correct |
59 |
Correct |
108 ms |
43404 KB |
Output is correct |
60 |
Correct |
71 ms |
35220 KB |
Output is correct |
61 |
Correct |
72 ms |
42884 KB |
Output is correct |
62 |
Correct |
112 ms |
41576 KB |
Output is correct |
63 |
Correct |
108 ms |
43308 KB |
Output is correct |
64 |
Correct |
117 ms |
43436 KB |
Output is correct |
65 |
Correct |
63 ms |
35276 KB |
Output is correct |
66 |
Correct |
66 ms |
42416 KB |
Output is correct |
67 |
Correct |
100 ms |
39560 KB |
Output is correct |
68 |
Correct |
104 ms |
41564 KB |
Output is correct |
69 |
Correct |
106 ms |
41644 KB |
Output is correct |
70 |
Correct |
105 ms |
43428 KB |
Output is correct |
71 |
Correct |
117 ms |
43380 KB |
Output is correct |
72 |
Correct |
115 ms |
43456 KB |
Output is correct |
73 |
Correct |
104 ms |
43308 KB |
Output is correct |
74 |
Correct |
62 ms |
43092 KB |
Output is correct |
75 |
Correct |
66 ms |
35300 KB |
Output is correct |
76 |
Correct |
64 ms |
40064 KB |
Output is correct |
77 |
Correct |
60 ms |
35332 KB |
Output is correct |
78 |
Correct |
1423 ms |
41192 KB |
Output is correct |
79 |
Correct |
2027 ms |
41648 KB |
Output is correct |
80 |
Correct |
1927 ms |
41616 KB |
Output is correct |
81 |
Correct |
1979 ms |
43352 KB |
Output is correct |
82 |
Correct |
1830 ms |
43388 KB |
Output is correct |
83 |
Correct |
1884 ms |
43408 KB |
Output is correct |
84 |
Correct |
1901 ms |
43356 KB |
Output is correct |
85 |
Correct |
1336 ms |
43132 KB |
Output is correct |
86 |
Correct |
1211 ms |
35220 KB |
Output is correct |
87 |
Correct |
1367 ms |
41108 KB |
Output is correct |
88 |
Correct |
1410 ms |
35244 KB |
Output is correct |
89 |
Correct |
1336 ms |
43052 KB |
Output is correct |
90 |
Correct |
1124 ms |
35320 KB |
Output is correct |
91 |
Correct |
0 ms |
208 KB |
Output is correct |
92 |
Correct |
2 ms |
848 KB |
Output is correct |
93 |
Correct |
1 ms |
848 KB |
Output is correct |
94 |
Correct |
106 ms |
41536 KB |
Output is correct |
95 |
Correct |
115 ms |
43436 KB |
Output is correct |
96 |
Correct |
113 ms |
43420 KB |
Output is correct |
97 |
Correct |
62 ms |
35360 KB |
Output is correct |
98 |
Correct |
63 ms |
42884 KB |
Output is correct |
99 |
Correct |
105 ms |
41596 KB |
Output is correct |
100 |
Correct |
108 ms |
43372 KB |
Output is correct |
101 |
Correct |
112 ms |
43324 KB |
Output is correct |
102 |
Correct |
66 ms |
35364 KB |
Output is correct |
103 |
Correct |
63 ms |
42400 KB |
Output is correct |
104 |
Correct |
3 ms |
976 KB |
Output is correct |
105 |
Correct |
2 ms |
976 KB |
Output is correct |
106 |
Correct |
2 ms |
976 KB |
Output is correct |
107 |
Correct |
1 ms |
848 KB |
Output is correct |
108 |
Correct |
1 ms |
976 KB |
Output is correct |
109 |
Correct |
2 ms |
976 KB |
Output is correct |
110 |
Correct |
2 ms |
976 KB |
Output is correct |
111 |
Correct |
2 ms |
976 KB |
Output is correct |
112 |
Correct |
1 ms |
848 KB |
Output is correct |
113 |
Correct |
1 ms |
976 KB |
Output is correct |
114 |
Correct |
390 ms |
9544 KB |
Output is correct |
115 |
Correct |
1635 ms |
41620 KB |
Output is correct |
116 |
Correct |
1395 ms |
41600 KB |
Output is correct |
117 |
Correct |
1332 ms |
43404 KB |
Output is correct |
118 |
Correct |
1372 ms |
43324 KB |
Output is correct |
119 |
Correct |
1504 ms |
43432 KB |
Output is correct |
120 |
Correct |
1525 ms |
43392 KB |
Output is correct |
121 |
Correct |
924 ms |
43088 KB |
Output is correct |
122 |
Correct |
949 ms |
35328 KB |
Output is correct |
123 |
Correct |
1138 ms |
39924 KB |
Output is correct |
124 |
Correct |
1373 ms |
35268 KB |
Output is correct |
125 |
Correct |
119 ms |
41600 KB |
Output is correct |
126 |
Correct |
127 ms |
43376 KB |
Output is correct |
127 |
Correct |
106 ms |
43436 KB |
Output is correct |
128 |
Correct |
60 ms |
35292 KB |
Output is correct |
129 |
Correct |
65 ms |
42388 KB |
Output is correct |
130 |
Correct |
115 ms |
39620 KB |
Output is correct |
131 |
Correct |
130 ms |
41596 KB |
Output is correct |
132 |
Correct |
109 ms |
41616 KB |
Output is correct |
133 |
Correct |
127 ms |
43432 KB |
Output is correct |
134 |
Correct |
137 ms |
43404 KB |
Output is correct |
135 |
Correct |
106 ms |
43392 KB |
Output is correct |
136 |
Correct |
134 ms |
43388 KB |
Output is correct |
137 |
Correct |
66 ms |
43040 KB |
Output is correct |
138 |
Correct |
60 ms |
35328 KB |
Output is correct |
139 |
Correct |
67 ms |
40108 KB |
Output is correct |
140 |
Correct |
84 ms |
35344 KB |
Output is correct |
141 |
Correct |
2 ms |
976 KB |
Output is correct |
142 |
Correct |
2 ms |
912 KB |
Output is correct |
143 |
Correct |
2 ms |
976 KB |
Output is correct |
144 |
Correct |
1 ms |
848 KB |
Output is correct |
145 |
Correct |
2 ms |
976 KB |
Output is correct |
146 |
Correct |
1 ms |
592 KB |
Output is correct |
147 |
Correct |
2 ms |
976 KB |
Output is correct |
148 |
Correct |
2 ms |
976 KB |
Output is correct |
149 |
Correct |
2 ms |
976 KB |
Output is correct |
150 |
Correct |
2 ms |
976 KB |
Output is correct |
151 |
Correct |
2 ms |
976 KB |
Output is correct |
152 |
Correct |
2 ms |
976 KB |
Output is correct |
153 |
Correct |
2 ms |
976 KB |
Output is correct |
154 |
Correct |
1 ms |
848 KB |
Output is correct |
155 |
Correct |
2 ms |
976 KB |
Output is correct |
156 |
Correct |
2 ms |
848 KB |
Output is correct |
157 |
Correct |
1787 ms |
36172 KB |
Output is correct |
158 |
Correct |
2057 ms |
41484 KB |
Output is correct |
159 |
Correct |
2146 ms |
41620 KB |
Output is correct |
160 |
Correct |
2065 ms |
43420 KB |
Output is correct |
161 |
Correct |
1810 ms |
43436 KB |
Output is correct |
162 |
Correct |
1886 ms |
43392 KB |
Output is correct |
163 |
Correct |
2054 ms |
43408 KB |
Output is correct |
164 |
Correct |
945 ms |
43136 KB |
Output is correct |
165 |
Correct |
930 ms |
35332 KB |
Output is correct |
166 |
Correct |
1064 ms |
41448 KB |
Output is correct |
167 |
Correct |
1130 ms |
35236 KB |
Output is correct |
168 |
Correct |
0 ms |
208 KB |
Output is correct |
169 |
Correct |
1169 ms |
13988 KB |
Output is correct |
170 |
Correct |
1790 ms |
41436 KB |
Output is correct |
171 |
Correct |
2304 ms |
41516 KB |
Output is correct |
172 |
Correct |
1863 ms |
43400 KB |
Output is correct |
173 |
Correct |
2185 ms |
43412 KB |
Output is correct |
174 |
Correct |
1861 ms |
43436 KB |
Output is correct |
175 |
Correct |
1984 ms |
43520 KB |
Output is correct |
176 |
Correct |
1057 ms |
43156 KB |
Output is correct |
177 |
Correct |
910 ms |
35288 KB |
Output is correct |
178 |
Correct |
1110 ms |
40208 KB |
Output is correct |
179 |
Correct |
1071 ms |
35332 KB |
Output is correct |