#include <bits/stdc++.h>
#include "towers.h"
#define F first
#define S second
using namespace std;
const int N = 1e5 + 10 , inf = 1e9 , Lg = 17;
int n , a[N] , rmxq[N][Lg] , rmnq[N][Lg] , lg2[N] , nexL[N] , nexR[N] , las;
int b[N] , psum[N] , m , mvR[N][Lg] , mvL[N][Lg];
vector <pair<int ,int>> all;
int mn_pos(int aa , int bb)
{
if(a[aa] < a[bb])
return aa;
return bb;
}
int mx_pos(int aa , int bb)
{
if(a[aa] > a[bb])
return aa;
return bb;
}
int Get_mx(int l , int r)
{
r++;
int sz = (r - l); sz = lg2[sz];
return mx_pos(rmxq[l][sz] , rmxq[r - (1 << sz)][sz]);
}
int Get_mn(int l , int r)
{
r++;
int sz = (r - l); sz = lg2[sz];
return mn_pos(rmnq[l][sz] , rmnq[r - (1 << sz)][sz]);
}
struct SEG{
vector <int> vec[N << 2];
int mn[N << 2] , mx[N << 2];
void Build(int node = 1 , int nl = 0 , int nr = m)
{
if(nr - nl == 1)
{
vec[node].push_back(all[nl].S);
mn[node] = all[nl].F;
mx[node] = all[nl].F;
return;
}
int mid = (nl + nr) >> 1 , lc = node << 1 , rc = lc | 1;
Build(lc , nl , mid); Build(rc , mid , nr);
vec[node] = vec[lc];
for(auto u : vec[rc])
vec[node].push_back(u);
sort(vec[node].begin() , vec[node].end());
mn[node] = min(mn[lc] , mn[rc]);
mx[node] = max(mx[lc] , mx[rc]);
}
int Get(int val , int l , int r , int node = 1 , int nl = 0 , int nr = m)
{
if(mx[node] < val)
return 0;
if(mn[node] >= val)
{
return upper_bound(vec[node].begin() , vec[node].end() , r) - lower_bound(vec[node].begin() , vec[node].end() , l);
}
int mid = (nl + nr) >> 1 , lc = node << 1 , rc = lc | 1;
return Get(val , l , r , lc , nl , mid) + Get(val , l , r , rc , mid , nr);
}
} seg;
void Build()
{
lg2[1] = 0;
for(int i = 2 ; i < N ; i++)
lg2[i] = lg2[i / 2] + 1;
for(int i = 0 ; i < n ; i++)
rmnq[i][0] = rmxq[i][0] = i;
for(int j = 1 ; j < Lg ; j++)
{
int len = (1 << j);
for(int i = 0 ; i + len <= n ; i++)
{
rmnq[i][j] = mn_pos(rmnq[i][j - 1] , rmnq[i + len / 2][j - 1]);
rmxq[i][j] = mx_pos(rmxq[i][j - 1] , rmxq[i + len / 2][j - 1]);
}
}
vector <int> st;
for(int i = 0 ; i < n ; i++)
{
nexL[i] = -1;
nexR[i] = n;
while(!st.empty())
{
if(a[st.back()] < a[i])
{
nexR[st.back()] = i;
st.pop_back();
}
else
{
nexL[i] = st.back();
break;
}
}
st.push_back(i);
}
for(int i = 0 ; i < n ; i++) if(i - nexL[i] > 1 && nexR[i] - i > 1)
{
int lc = Get_mn(nexL[i] + 1 , i - 1) , rc = Get_mn(i + 1 , nexR[i] - 1);
all.push_back(make_pair(a[i] - max(a[lc] , a[rc]) , i));
}
sort(all.begin() , all.end());
/*for(auto u : all)
cout << u.F << " " << u.S << endl;
*/
for(int i = 0 ; i < n ; i++)
{
mvL[i][0] = nexL[i];
mvR[i][0] = nexR[i];
}
for(int j = 1 ; j < Lg ; j++) for(int i = 0 ; i < n ; i++)
{
if(mvL[i][j - 1] == -1)
mvL[i][j] = -1;
else
mvL[i][j] = mvL[mvL[i][j - 1]][j - 1];
if(mvR[i][j - 1] == n)
mvR[i][j] = n;
else
mvR[i][j] = mvR[mvR[i][j - 1]][j - 1];
}
m = all.size();
if(m == 0)
return;
seg.Build();
}
void init(int nn , vector <int> vec)
{
n = nn;
for(int i = 0 ; i < n ; i++)
a[i] = vec[i];
Build();
}
int max_towers(int l , int r , int d)
{
int L = l , R = r;
for(int i = Lg - 1 ; i >= 0 ; i--) if(mvR[L][i] <= r)
{
int id = mvR[L][i];
if(a[id] - a[Get_mn(l , id)] < d)
L = id;
}
for(int i = Lg - 1 ; i >= 0 ; i--) if(mvL[R][i] >= l)
{
int id = mvL[R][i];
if(a[id] - a[Get_mn(id , r)] < d)
R = id;
}
//cout << L << " " << R << endl;
if(L + 1 >= R || m == 0)
return 1;
return 1 + seg.Get(d , L + 1 , R - 1);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
290 ms |
40300 KB |
Output is correct |
2 |
Correct |
627 ms |
42756 KB |
Output is correct |
3 |
Correct |
584 ms |
42584 KB |
Output is correct |
4 |
Correct |
640 ms |
40676 KB |
Output is correct |
5 |
Correct |
640 ms |
41172 KB |
Output is correct |
6 |
Correct |
595 ms |
42584 KB |
Output is correct |
7 |
Correct |
588 ms |
41168 KB |
Output is correct |
8 |
Correct |
3 ms |
25176 KB |
Output is correct |
9 |
Correct |
3 ms |
25176 KB |
Output is correct |
10 |
Correct |
3 ms |
23128 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
25176 KB |
Output is correct |
2 |
Correct |
3 ms |
25176 KB |
Output is correct |
3 |
Correct |
3 ms |
25176 KB |
Output is correct |
4 |
Correct |
3 ms |
25176 KB |
Output is correct |
5 |
Correct |
3 ms |
25176 KB |
Output is correct |
6 |
Correct |
3 ms |
25176 KB |
Output is correct |
7 |
Correct |
3 ms |
25176 KB |
Output is correct |
8 |
Correct |
2 ms |
23176 KB |
Output is correct |
9 |
Correct |
2 ms |
23128 KB |
Output is correct |
10 |
Correct |
2 ms |
25176 KB |
Output is correct |
11 |
Correct |
3 ms |
25176 KB |
Output is correct |
12 |
Correct |
3 ms |
25176 KB |
Output is correct |
13 |
Correct |
3 ms |
25180 KB |
Output is correct |
14 |
Correct |
3 ms |
23128 KB |
Output is correct |
15 |
Correct |
3 ms |
25252 KB |
Output is correct |
16 |
Correct |
3 ms |
25176 KB |
Output is correct |
17 |
Correct |
3 ms |
25176 KB |
Output is correct |
18 |
Correct |
2 ms |
23128 KB |
Output is correct |
19 |
Correct |
3 ms |
25176 KB |
Output is correct |
20 |
Correct |
3 ms |
25176 KB |
Output is correct |
21 |
Correct |
3 ms |
25176 KB |
Output is correct |
22 |
Correct |
3 ms |
25176 KB |
Output is correct |
23 |
Correct |
3 ms |
23128 KB |
Output is correct |
24 |
Correct |
3 ms |
25176 KB |
Output is correct |
25 |
Correct |
3 ms |
25176 KB |
Output is correct |
26 |
Correct |
3 ms |
25176 KB |
Output is correct |
27 |
Correct |
3 ms |
25176 KB |
Output is correct |
28 |
Correct |
3 ms |
25256 KB |
Output is correct |
29 |
Correct |
4 ms |
25176 KB |
Output is correct |
30 |
Correct |
3 ms |
25176 KB |
Output is correct |
31 |
Correct |
3 ms |
25176 KB |
Output is correct |
32 |
Correct |
3 ms |
23128 KB |
Output is correct |
33 |
Correct |
2 ms |
23128 KB |
Output is correct |
34 |
Correct |
3 ms |
25176 KB |
Output is correct |
35 |
Correct |
3 ms |
25180 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
25176 KB |
Output is correct |
2 |
Correct |
3 ms |
25176 KB |
Output is correct |
3 |
Correct |
3 ms |
25176 KB |
Output is correct |
4 |
Correct |
3 ms |
25176 KB |
Output is correct |
5 |
Correct |
3 ms |
25176 KB |
Output is correct |
6 |
Correct |
3 ms |
25176 KB |
Output is correct |
7 |
Correct |
3 ms |
25176 KB |
Output is correct |
8 |
Correct |
2 ms |
23176 KB |
Output is correct |
9 |
Correct |
2 ms |
23128 KB |
Output is correct |
10 |
Correct |
2 ms |
25176 KB |
Output is correct |
11 |
Correct |
3 ms |
25176 KB |
Output is correct |
12 |
Correct |
3 ms |
25176 KB |
Output is correct |
13 |
Correct |
3 ms |
25180 KB |
Output is correct |
14 |
Correct |
3 ms |
23128 KB |
Output is correct |
15 |
Correct |
3 ms |
25252 KB |
Output is correct |
16 |
Correct |
3 ms |
25176 KB |
Output is correct |
17 |
Correct |
3 ms |
25176 KB |
Output is correct |
18 |
Correct |
2 ms |
23128 KB |
Output is correct |
19 |
Correct |
3 ms |
25176 KB |
Output is correct |
20 |
Correct |
3 ms |
25176 KB |
Output is correct |
21 |
Correct |
3 ms |
25176 KB |
Output is correct |
22 |
Correct |
3 ms |
25176 KB |
Output is correct |
23 |
Correct |
3 ms |
23128 KB |
Output is correct |
24 |
Correct |
3 ms |
25176 KB |
Output is correct |
25 |
Correct |
3 ms |
25176 KB |
Output is correct |
26 |
Correct |
3 ms |
25176 KB |
Output is correct |
27 |
Correct |
3 ms |
25176 KB |
Output is correct |
28 |
Correct |
3 ms |
25256 KB |
Output is correct |
29 |
Correct |
4 ms |
25176 KB |
Output is correct |
30 |
Correct |
3 ms |
25176 KB |
Output is correct |
31 |
Correct |
3 ms |
25176 KB |
Output is correct |
32 |
Correct |
3 ms |
23128 KB |
Output is correct |
33 |
Correct |
2 ms |
23128 KB |
Output is correct |
34 |
Correct |
3 ms |
25176 KB |
Output is correct |
35 |
Correct |
3 ms |
25180 KB |
Output is correct |
36 |
Correct |
24 ms |
45268 KB |
Output is correct |
37 |
Correct |
37 ms |
47304 KB |
Output is correct |
38 |
Correct |
36 ms |
47260 KB |
Output is correct |
39 |
Correct |
45 ms |
49868 KB |
Output is correct |
40 |
Correct |
45 ms |
49664 KB |
Output is correct |
41 |
Correct |
50 ms |
49864 KB |
Output is correct |
42 |
Correct |
46 ms |
49860 KB |
Output is correct |
43 |
Correct |
24 ms |
40528 KB |
Output is correct |
44 |
Correct |
20 ms |
41168 KB |
Output is correct |
45 |
Correct |
21 ms |
42584 KB |
Output is correct |
46 |
Correct |
25 ms |
42956 KB |
Output is correct |
47 |
Correct |
36 ms |
47004 KB |
Output is correct |
48 |
Correct |
46 ms |
49868 KB |
Output is correct |
49 |
Correct |
48 ms |
49860 KB |
Output is correct |
50 |
Correct |
19 ms |
41168 KB |
Output is correct |
51 |
Correct |
20 ms |
42688 KB |
Output is correct |
52 |
Correct |
36 ms |
47048 KB |
Output is correct |
53 |
Correct |
46 ms |
49864 KB |
Output is correct |
54 |
Correct |
47 ms |
49864 KB |
Output is correct |
55 |
Correct |
21 ms |
41168 KB |
Output is correct |
56 |
Correct |
21 ms |
42584 KB |
Output is correct |
57 |
Correct |
36 ms |
47052 KB |
Output is correct |
58 |
Correct |
36 ms |
47180 KB |
Output is correct |
59 |
Correct |
36 ms |
47304 KB |
Output is correct |
60 |
Correct |
51 ms |
49864 KB |
Output is correct |
61 |
Correct |
51 ms |
49864 KB |
Output is correct |
62 |
Correct |
47 ms |
49720 KB |
Output is correct |
63 |
Correct |
50 ms |
49692 KB |
Output is correct |
64 |
Correct |
21 ms |
40536 KB |
Output is correct |
65 |
Correct |
19 ms |
41168 KB |
Output is correct |
66 |
Correct |
19 ms |
42688 KB |
Output is correct |
67 |
Correct |
23 ms |
43216 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
469 ms |
47048 KB |
Output is correct |
2 |
Correct |
646 ms |
47304 KB |
Output is correct |
3 |
Correct |
628 ms |
47304 KB |
Output is correct |
4 |
Correct |
586 ms |
49712 KB |
Output is correct |
5 |
Correct |
626 ms |
49864 KB |
Output is correct |
6 |
Correct |
627 ms |
49864 KB |
Output is correct |
7 |
Correct |
639 ms |
49604 KB |
Output is correct |
8 |
Correct |
575 ms |
40536 KB |
Output is correct |
9 |
Correct |
612 ms |
41168 KB |
Output is correct |
10 |
Correct |
593 ms |
42584 KB |
Output is correct |
11 |
Correct |
572 ms |
42960 KB |
Output is correct |
12 |
Correct |
584 ms |
42584 KB |
Output is correct |
13 |
Correct |
572 ms |
41024 KB |
Output is correct |
14 |
Correct |
3 ms |
25176 KB |
Output is correct |
15 |
Correct |
3 ms |
25176 KB |
Output is correct |
16 |
Correct |
2 ms |
23128 KB |
Output is correct |
17 |
Correct |
37 ms |
47156 KB |
Output is correct |
18 |
Correct |
51 ms |
49864 KB |
Output is correct |
19 |
Correct |
46 ms |
49864 KB |
Output is correct |
20 |
Correct |
19 ms |
41168 KB |
Output is correct |
21 |
Correct |
19 ms |
42584 KB |
Output is correct |
22 |
Correct |
38 ms |
47048 KB |
Output is correct |
23 |
Correct |
45 ms |
49888 KB |
Output is correct |
24 |
Correct |
46 ms |
49864 KB |
Output is correct |
25 |
Correct |
20 ms |
41168 KB |
Output is correct |
26 |
Correct |
19 ms |
42616 KB |
Output is correct |
27 |
Correct |
3 ms |
25176 KB |
Output is correct |
28 |
Correct |
3 ms |
25176 KB |
Output is correct |
29 |
Correct |
3 ms |
25180 KB |
Output is correct |
30 |
Correct |
3 ms |
23128 KB |
Output is correct |
31 |
Correct |
3 ms |
25176 KB |
Output is correct |
32 |
Correct |
3 ms |
25176 KB |
Output is correct |
33 |
Correct |
3 ms |
25176 KB |
Output is correct |
34 |
Correct |
3 ms |
25176 KB |
Output is correct |
35 |
Correct |
2 ms |
23128 KB |
Output is correct |
36 |
Correct |
3 ms |
25240 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
180 ms |
32848 KB |
Output is correct |
2 |
Correct |
630 ms |
47164 KB |
Output is correct |
3 |
Correct |
620 ms |
47304 KB |
Output is correct |
4 |
Correct |
624 ms |
49864 KB |
Output is correct |
5 |
Correct |
652 ms |
49608 KB |
Output is correct |
6 |
Correct |
654 ms |
49864 KB |
Output is correct |
7 |
Correct |
605 ms |
49760 KB |
Output is correct |
8 |
Correct |
626 ms |
40536 KB |
Output is correct |
9 |
Correct |
611 ms |
41168 KB |
Output is correct |
10 |
Correct |
567 ms |
42692 KB |
Output is correct |
11 |
Correct |
606 ms |
43212 KB |
Output is correct |
12 |
Correct |
36 ms |
47048 KB |
Output is correct |
13 |
Correct |
46 ms |
49864 KB |
Output is correct |
14 |
Correct |
46 ms |
49864 KB |
Output is correct |
15 |
Correct |
25 ms |
41152 KB |
Output is correct |
16 |
Correct |
25 ms |
42584 KB |
Output is correct |
17 |
Correct |
41 ms |
47052 KB |
Output is correct |
18 |
Correct |
36 ms |
47312 KB |
Output is correct |
19 |
Correct |
36 ms |
47448 KB |
Output is correct |
20 |
Correct |
48 ms |
49764 KB |
Output is correct |
21 |
Correct |
46 ms |
49688 KB |
Output is correct |
22 |
Correct |
47 ms |
50068 KB |
Output is correct |
23 |
Correct |
45 ms |
49612 KB |
Output is correct |
24 |
Correct |
19 ms |
40456 KB |
Output is correct |
25 |
Correct |
22 ms |
41168 KB |
Output is correct |
26 |
Correct |
22 ms |
42576 KB |
Output is correct |
27 |
Correct |
20 ms |
43216 KB |
Output is correct |
28 |
Correct |
3 ms |
25176 KB |
Output is correct |
29 |
Correct |
3 ms |
25176 KB |
Output is correct |
30 |
Correct |
3 ms |
25176 KB |
Output is correct |
31 |
Correct |
3 ms |
23128 KB |
Output is correct |
32 |
Correct |
3 ms |
25176 KB |
Output is correct |
33 |
Correct |
2 ms |
25176 KB |
Output is correct |
34 |
Correct |
3 ms |
25176 KB |
Output is correct |
35 |
Correct |
3 ms |
25176 KB |
Output is correct |
36 |
Correct |
3 ms |
25176 KB |
Output is correct |
37 |
Correct |
3 ms |
25176 KB |
Output is correct |
38 |
Correct |
3 ms |
25176 KB |
Output is correct |
39 |
Correct |
3 ms |
25176 KB |
Output is correct |
40 |
Correct |
3 ms |
23128 KB |
Output is correct |
41 |
Correct |
3 ms |
23128 KB |
Output is correct |
42 |
Correct |
2 ms |
25240 KB |
Output is correct |
43 |
Correct |
3 ms |
25176 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
25176 KB |
Output is correct |
2 |
Correct |
3 ms |
25176 KB |
Output is correct |
3 |
Correct |
3 ms |
25176 KB |
Output is correct |
4 |
Correct |
3 ms |
25176 KB |
Output is correct |
5 |
Correct |
3 ms |
25176 KB |
Output is correct |
6 |
Correct |
3 ms |
25176 KB |
Output is correct |
7 |
Correct |
3 ms |
25176 KB |
Output is correct |
8 |
Correct |
2 ms |
23176 KB |
Output is correct |
9 |
Correct |
2 ms |
23128 KB |
Output is correct |
10 |
Correct |
2 ms |
25176 KB |
Output is correct |
11 |
Correct |
3 ms |
25176 KB |
Output is correct |
12 |
Correct |
3 ms |
25176 KB |
Output is correct |
13 |
Correct |
3 ms |
25180 KB |
Output is correct |
14 |
Correct |
3 ms |
23128 KB |
Output is correct |
15 |
Correct |
3 ms |
25252 KB |
Output is correct |
16 |
Correct |
3 ms |
25176 KB |
Output is correct |
17 |
Correct |
3 ms |
25176 KB |
Output is correct |
18 |
Correct |
2 ms |
23128 KB |
Output is correct |
19 |
Correct |
3 ms |
25176 KB |
Output is correct |
20 |
Correct |
3 ms |
25176 KB |
Output is correct |
21 |
Correct |
3 ms |
25176 KB |
Output is correct |
22 |
Correct |
3 ms |
25176 KB |
Output is correct |
23 |
Correct |
3 ms |
23128 KB |
Output is correct |
24 |
Correct |
3 ms |
25176 KB |
Output is correct |
25 |
Correct |
3 ms |
25176 KB |
Output is correct |
26 |
Correct |
3 ms |
25176 KB |
Output is correct |
27 |
Correct |
3 ms |
25176 KB |
Output is correct |
28 |
Correct |
3 ms |
25256 KB |
Output is correct |
29 |
Correct |
4 ms |
25176 KB |
Output is correct |
30 |
Correct |
3 ms |
25176 KB |
Output is correct |
31 |
Correct |
3 ms |
25176 KB |
Output is correct |
32 |
Correct |
3 ms |
23128 KB |
Output is correct |
33 |
Correct |
2 ms |
23128 KB |
Output is correct |
34 |
Correct |
3 ms |
25176 KB |
Output is correct |
35 |
Correct |
3 ms |
25180 KB |
Output is correct |
36 |
Correct |
24 ms |
45268 KB |
Output is correct |
37 |
Correct |
37 ms |
47304 KB |
Output is correct |
38 |
Correct |
36 ms |
47260 KB |
Output is correct |
39 |
Correct |
45 ms |
49868 KB |
Output is correct |
40 |
Correct |
45 ms |
49664 KB |
Output is correct |
41 |
Correct |
50 ms |
49864 KB |
Output is correct |
42 |
Correct |
46 ms |
49860 KB |
Output is correct |
43 |
Correct |
24 ms |
40528 KB |
Output is correct |
44 |
Correct |
20 ms |
41168 KB |
Output is correct |
45 |
Correct |
21 ms |
42584 KB |
Output is correct |
46 |
Correct |
25 ms |
42956 KB |
Output is correct |
47 |
Correct |
36 ms |
47004 KB |
Output is correct |
48 |
Correct |
46 ms |
49868 KB |
Output is correct |
49 |
Correct |
48 ms |
49860 KB |
Output is correct |
50 |
Correct |
19 ms |
41168 KB |
Output is correct |
51 |
Correct |
20 ms |
42688 KB |
Output is correct |
52 |
Correct |
36 ms |
47048 KB |
Output is correct |
53 |
Correct |
46 ms |
49864 KB |
Output is correct |
54 |
Correct |
47 ms |
49864 KB |
Output is correct |
55 |
Correct |
21 ms |
41168 KB |
Output is correct |
56 |
Correct |
21 ms |
42584 KB |
Output is correct |
57 |
Correct |
36 ms |
47052 KB |
Output is correct |
58 |
Correct |
36 ms |
47180 KB |
Output is correct |
59 |
Correct |
36 ms |
47304 KB |
Output is correct |
60 |
Correct |
51 ms |
49864 KB |
Output is correct |
61 |
Correct |
51 ms |
49864 KB |
Output is correct |
62 |
Correct |
47 ms |
49720 KB |
Output is correct |
63 |
Correct |
50 ms |
49692 KB |
Output is correct |
64 |
Correct |
21 ms |
40536 KB |
Output is correct |
65 |
Correct |
19 ms |
41168 KB |
Output is correct |
66 |
Correct |
19 ms |
42688 KB |
Output is correct |
67 |
Correct |
23 ms |
43216 KB |
Output is correct |
68 |
Correct |
469 ms |
47048 KB |
Output is correct |
69 |
Correct |
646 ms |
47304 KB |
Output is correct |
70 |
Correct |
628 ms |
47304 KB |
Output is correct |
71 |
Correct |
586 ms |
49712 KB |
Output is correct |
72 |
Correct |
626 ms |
49864 KB |
Output is correct |
73 |
Correct |
627 ms |
49864 KB |
Output is correct |
74 |
Correct |
639 ms |
49604 KB |
Output is correct |
75 |
Correct |
575 ms |
40536 KB |
Output is correct |
76 |
Correct |
612 ms |
41168 KB |
Output is correct |
77 |
Correct |
593 ms |
42584 KB |
Output is correct |
78 |
Correct |
572 ms |
42960 KB |
Output is correct |
79 |
Correct |
584 ms |
42584 KB |
Output is correct |
80 |
Correct |
572 ms |
41024 KB |
Output is correct |
81 |
Correct |
3 ms |
25176 KB |
Output is correct |
82 |
Correct |
3 ms |
25176 KB |
Output is correct |
83 |
Correct |
2 ms |
23128 KB |
Output is correct |
84 |
Correct |
37 ms |
47156 KB |
Output is correct |
85 |
Correct |
51 ms |
49864 KB |
Output is correct |
86 |
Correct |
46 ms |
49864 KB |
Output is correct |
87 |
Correct |
19 ms |
41168 KB |
Output is correct |
88 |
Correct |
19 ms |
42584 KB |
Output is correct |
89 |
Correct |
38 ms |
47048 KB |
Output is correct |
90 |
Correct |
45 ms |
49888 KB |
Output is correct |
91 |
Correct |
46 ms |
49864 KB |
Output is correct |
92 |
Correct |
20 ms |
41168 KB |
Output is correct |
93 |
Correct |
19 ms |
42616 KB |
Output is correct |
94 |
Correct |
3 ms |
25176 KB |
Output is correct |
95 |
Correct |
3 ms |
25176 KB |
Output is correct |
96 |
Correct |
3 ms |
25180 KB |
Output is correct |
97 |
Correct |
3 ms |
23128 KB |
Output is correct |
98 |
Correct |
3 ms |
25176 KB |
Output is correct |
99 |
Correct |
3 ms |
25176 KB |
Output is correct |
100 |
Correct |
3 ms |
25176 KB |
Output is correct |
101 |
Correct |
3 ms |
25176 KB |
Output is correct |
102 |
Correct |
2 ms |
23128 KB |
Output is correct |
103 |
Correct |
3 ms |
25240 KB |
Output is correct |
104 |
Correct |
597 ms |
46520 KB |
Output is correct |
105 |
Correct |
683 ms |
47272 KB |
Output is correct |
106 |
Correct |
668 ms |
47312 KB |
Output is correct |
107 |
Correct |
733 ms |
49864 KB |
Output is correct |
108 |
Correct |
665 ms |
49864 KB |
Output is correct |
109 |
Correct |
717 ms |
49864 KB |
Output is correct |
110 |
Correct |
689 ms |
49724 KB |
Output is correct |
111 |
Correct |
622 ms |
40536 KB |
Output is correct |
112 |
Correct |
600 ms |
41168 KB |
Output is correct |
113 |
Correct |
583 ms |
42584 KB |
Output is correct |
114 |
Correct |
611 ms |
42964 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
290 ms |
40300 KB |
Output is correct |
2 |
Correct |
627 ms |
42756 KB |
Output is correct |
3 |
Correct |
584 ms |
42584 KB |
Output is correct |
4 |
Correct |
640 ms |
40676 KB |
Output is correct |
5 |
Correct |
640 ms |
41172 KB |
Output is correct |
6 |
Correct |
595 ms |
42584 KB |
Output is correct |
7 |
Correct |
588 ms |
41168 KB |
Output is correct |
8 |
Correct |
3 ms |
25176 KB |
Output is correct |
9 |
Correct |
3 ms |
25176 KB |
Output is correct |
10 |
Correct |
3 ms |
23128 KB |
Output is correct |
11 |
Correct |
3 ms |
25176 KB |
Output is correct |
12 |
Correct |
3 ms |
25176 KB |
Output is correct |
13 |
Correct |
3 ms |
25176 KB |
Output is correct |
14 |
Correct |
3 ms |
25176 KB |
Output is correct |
15 |
Correct |
3 ms |
25176 KB |
Output is correct |
16 |
Correct |
3 ms |
25176 KB |
Output is correct |
17 |
Correct |
3 ms |
25176 KB |
Output is correct |
18 |
Correct |
2 ms |
23176 KB |
Output is correct |
19 |
Correct |
2 ms |
23128 KB |
Output is correct |
20 |
Correct |
2 ms |
25176 KB |
Output is correct |
21 |
Correct |
3 ms |
25176 KB |
Output is correct |
22 |
Correct |
3 ms |
25176 KB |
Output is correct |
23 |
Correct |
3 ms |
25180 KB |
Output is correct |
24 |
Correct |
3 ms |
23128 KB |
Output is correct |
25 |
Correct |
3 ms |
25252 KB |
Output is correct |
26 |
Correct |
3 ms |
25176 KB |
Output is correct |
27 |
Correct |
3 ms |
25176 KB |
Output is correct |
28 |
Correct |
2 ms |
23128 KB |
Output is correct |
29 |
Correct |
3 ms |
25176 KB |
Output is correct |
30 |
Correct |
3 ms |
25176 KB |
Output is correct |
31 |
Correct |
3 ms |
25176 KB |
Output is correct |
32 |
Correct |
3 ms |
25176 KB |
Output is correct |
33 |
Correct |
3 ms |
23128 KB |
Output is correct |
34 |
Correct |
3 ms |
25176 KB |
Output is correct |
35 |
Correct |
3 ms |
25176 KB |
Output is correct |
36 |
Correct |
3 ms |
25176 KB |
Output is correct |
37 |
Correct |
3 ms |
25176 KB |
Output is correct |
38 |
Correct |
3 ms |
25256 KB |
Output is correct |
39 |
Correct |
4 ms |
25176 KB |
Output is correct |
40 |
Correct |
3 ms |
25176 KB |
Output is correct |
41 |
Correct |
3 ms |
25176 KB |
Output is correct |
42 |
Correct |
3 ms |
23128 KB |
Output is correct |
43 |
Correct |
2 ms |
23128 KB |
Output is correct |
44 |
Correct |
3 ms |
25176 KB |
Output is correct |
45 |
Correct |
3 ms |
25180 KB |
Output is correct |
46 |
Correct |
24 ms |
45268 KB |
Output is correct |
47 |
Correct |
37 ms |
47304 KB |
Output is correct |
48 |
Correct |
36 ms |
47260 KB |
Output is correct |
49 |
Correct |
45 ms |
49868 KB |
Output is correct |
50 |
Correct |
45 ms |
49664 KB |
Output is correct |
51 |
Correct |
50 ms |
49864 KB |
Output is correct |
52 |
Correct |
46 ms |
49860 KB |
Output is correct |
53 |
Correct |
24 ms |
40528 KB |
Output is correct |
54 |
Correct |
20 ms |
41168 KB |
Output is correct |
55 |
Correct |
21 ms |
42584 KB |
Output is correct |
56 |
Correct |
25 ms |
42956 KB |
Output is correct |
57 |
Correct |
36 ms |
47004 KB |
Output is correct |
58 |
Correct |
46 ms |
49868 KB |
Output is correct |
59 |
Correct |
48 ms |
49860 KB |
Output is correct |
60 |
Correct |
19 ms |
41168 KB |
Output is correct |
61 |
Correct |
20 ms |
42688 KB |
Output is correct |
62 |
Correct |
36 ms |
47048 KB |
Output is correct |
63 |
Correct |
46 ms |
49864 KB |
Output is correct |
64 |
Correct |
47 ms |
49864 KB |
Output is correct |
65 |
Correct |
21 ms |
41168 KB |
Output is correct |
66 |
Correct |
21 ms |
42584 KB |
Output is correct |
67 |
Correct |
36 ms |
47052 KB |
Output is correct |
68 |
Correct |
36 ms |
47180 KB |
Output is correct |
69 |
Correct |
36 ms |
47304 KB |
Output is correct |
70 |
Correct |
51 ms |
49864 KB |
Output is correct |
71 |
Correct |
51 ms |
49864 KB |
Output is correct |
72 |
Correct |
47 ms |
49720 KB |
Output is correct |
73 |
Correct |
50 ms |
49692 KB |
Output is correct |
74 |
Correct |
21 ms |
40536 KB |
Output is correct |
75 |
Correct |
19 ms |
41168 KB |
Output is correct |
76 |
Correct |
19 ms |
42688 KB |
Output is correct |
77 |
Correct |
23 ms |
43216 KB |
Output is correct |
78 |
Correct |
469 ms |
47048 KB |
Output is correct |
79 |
Correct |
646 ms |
47304 KB |
Output is correct |
80 |
Correct |
628 ms |
47304 KB |
Output is correct |
81 |
Correct |
586 ms |
49712 KB |
Output is correct |
82 |
Correct |
626 ms |
49864 KB |
Output is correct |
83 |
Correct |
627 ms |
49864 KB |
Output is correct |
84 |
Correct |
639 ms |
49604 KB |
Output is correct |
85 |
Correct |
575 ms |
40536 KB |
Output is correct |
86 |
Correct |
612 ms |
41168 KB |
Output is correct |
87 |
Correct |
593 ms |
42584 KB |
Output is correct |
88 |
Correct |
572 ms |
42960 KB |
Output is correct |
89 |
Correct |
584 ms |
42584 KB |
Output is correct |
90 |
Correct |
572 ms |
41024 KB |
Output is correct |
91 |
Correct |
3 ms |
25176 KB |
Output is correct |
92 |
Correct |
3 ms |
25176 KB |
Output is correct |
93 |
Correct |
2 ms |
23128 KB |
Output is correct |
94 |
Correct |
37 ms |
47156 KB |
Output is correct |
95 |
Correct |
51 ms |
49864 KB |
Output is correct |
96 |
Correct |
46 ms |
49864 KB |
Output is correct |
97 |
Correct |
19 ms |
41168 KB |
Output is correct |
98 |
Correct |
19 ms |
42584 KB |
Output is correct |
99 |
Correct |
38 ms |
47048 KB |
Output is correct |
100 |
Correct |
45 ms |
49888 KB |
Output is correct |
101 |
Correct |
46 ms |
49864 KB |
Output is correct |
102 |
Correct |
20 ms |
41168 KB |
Output is correct |
103 |
Correct |
19 ms |
42616 KB |
Output is correct |
104 |
Correct |
3 ms |
25176 KB |
Output is correct |
105 |
Correct |
3 ms |
25176 KB |
Output is correct |
106 |
Correct |
3 ms |
25180 KB |
Output is correct |
107 |
Correct |
3 ms |
23128 KB |
Output is correct |
108 |
Correct |
3 ms |
25176 KB |
Output is correct |
109 |
Correct |
3 ms |
25176 KB |
Output is correct |
110 |
Correct |
3 ms |
25176 KB |
Output is correct |
111 |
Correct |
3 ms |
25176 KB |
Output is correct |
112 |
Correct |
2 ms |
23128 KB |
Output is correct |
113 |
Correct |
3 ms |
25240 KB |
Output is correct |
114 |
Correct |
180 ms |
32848 KB |
Output is correct |
115 |
Correct |
630 ms |
47164 KB |
Output is correct |
116 |
Correct |
620 ms |
47304 KB |
Output is correct |
117 |
Correct |
624 ms |
49864 KB |
Output is correct |
118 |
Correct |
652 ms |
49608 KB |
Output is correct |
119 |
Correct |
654 ms |
49864 KB |
Output is correct |
120 |
Correct |
605 ms |
49760 KB |
Output is correct |
121 |
Correct |
626 ms |
40536 KB |
Output is correct |
122 |
Correct |
611 ms |
41168 KB |
Output is correct |
123 |
Correct |
567 ms |
42692 KB |
Output is correct |
124 |
Correct |
606 ms |
43212 KB |
Output is correct |
125 |
Correct |
36 ms |
47048 KB |
Output is correct |
126 |
Correct |
46 ms |
49864 KB |
Output is correct |
127 |
Correct |
46 ms |
49864 KB |
Output is correct |
128 |
Correct |
25 ms |
41152 KB |
Output is correct |
129 |
Correct |
25 ms |
42584 KB |
Output is correct |
130 |
Correct |
41 ms |
47052 KB |
Output is correct |
131 |
Correct |
36 ms |
47312 KB |
Output is correct |
132 |
Correct |
36 ms |
47448 KB |
Output is correct |
133 |
Correct |
48 ms |
49764 KB |
Output is correct |
134 |
Correct |
46 ms |
49688 KB |
Output is correct |
135 |
Correct |
47 ms |
50068 KB |
Output is correct |
136 |
Correct |
45 ms |
49612 KB |
Output is correct |
137 |
Correct |
19 ms |
40456 KB |
Output is correct |
138 |
Correct |
22 ms |
41168 KB |
Output is correct |
139 |
Correct |
22 ms |
42576 KB |
Output is correct |
140 |
Correct |
20 ms |
43216 KB |
Output is correct |
141 |
Correct |
3 ms |
25176 KB |
Output is correct |
142 |
Correct |
3 ms |
25176 KB |
Output is correct |
143 |
Correct |
3 ms |
25176 KB |
Output is correct |
144 |
Correct |
3 ms |
23128 KB |
Output is correct |
145 |
Correct |
3 ms |
25176 KB |
Output is correct |
146 |
Correct |
2 ms |
25176 KB |
Output is correct |
147 |
Correct |
3 ms |
25176 KB |
Output is correct |
148 |
Correct |
3 ms |
25176 KB |
Output is correct |
149 |
Correct |
3 ms |
25176 KB |
Output is correct |
150 |
Correct |
3 ms |
25176 KB |
Output is correct |
151 |
Correct |
3 ms |
25176 KB |
Output is correct |
152 |
Correct |
3 ms |
25176 KB |
Output is correct |
153 |
Correct |
3 ms |
23128 KB |
Output is correct |
154 |
Correct |
3 ms |
23128 KB |
Output is correct |
155 |
Correct |
2 ms |
25240 KB |
Output is correct |
156 |
Correct |
3 ms |
25176 KB |
Output is correct |
157 |
Correct |
597 ms |
46520 KB |
Output is correct |
158 |
Correct |
683 ms |
47272 KB |
Output is correct |
159 |
Correct |
668 ms |
47312 KB |
Output is correct |
160 |
Correct |
733 ms |
49864 KB |
Output is correct |
161 |
Correct |
665 ms |
49864 KB |
Output is correct |
162 |
Correct |
717 ms |
49864 KB |
Output is correct |
163 |
Correct |
689 ms |
49724 KB |
Output is correct |
164 |
Correct |
622 ms |
40536 KB |
Output is correct |
165 |
Correct |
600 ms |
41168 KB |
Output is correct |
166 |
Correct |
583 ms |
42584 KB |
Output is correct |
167 |
Correct |
611 ms |
42964 KB |
Output is correct |
168 |
Correct |
3 ms |
25176 KB |
Output is correct |
169 |
Correct |
426 ms |
35228 KB |
Output is correct |
170 |
Correct |
709 ms |
47208 KB |
Output is correct |
171 |
Correct |
715 ms |
47304 KB |
Output is correct |
172 |
Correct |
783 ms |
49864 KB |
Output is correct |
173 |
Correct |
693 ms |
49864 KB |
Output is correct |
174 |
Correct |
774 ms |
49868 KB |
Output is correct |
175 |
Correct |
724 ms |
49864 KB |
Output is correct |
176 |
Correct |
656 ms |
40652 KB |
Output is correct |
177 |
Correct |
645 ms |
40996 KB |
Output is correct |
178 |
Correct |
528 ms |
42672 KB |
Output is correct |
179 |
Correct |
640 ms |
43128 KB |
Output is correct |