#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int inf=1000000001;
struct nod;
extern nod*empt;
struct nod{
int val;
nod*l,*r;
nod()
{
l=r=this;
val=0;
}
nod(int x,nod*ll=empt,nod*rr=empt)
{
val=x;
l=ll,r=rr;
}
};
nod*empt=new nod();
nod*insert(nod*rt,int x,int st=0,int en=inf)
{
if(st>x||en<x)return rt;
if(st==en)return new nod(rt->val+1);
int mid=(st+en)>>1;
nod*s1=insert(rt->l,x,st,mid);
nod*s2=insert(rt->r,x,mid+1,en);
return new nod(s1->val+s2->val,s1,s2);
}
int cal(nod*rt1,nod*rt2,int l,int r,int st=0,int en=inf)
{
if(st>r||en<l)return 0;
if(st>=l && en<=r)return rt1->val-rt2->val;
int mid=(st+en)/2;
return cal(rt1->l,rt2->l,l,r,st,mid)+cal(rt1->r,rt2->r,l,r,mid+1,en);
}
nod*prs[100009];
int sg[4][400009];
int frs(int id,int l,int r,int d,int st,int en,int x=1)
{
if(st>r||en<l)return -1;
if(sg[id][x]<d)return -1;
if(st==en)return st;
int mid=(st+en)>>1;
int u=frs(id,l,r,d,st,mid,(x<<1));
if(u!=-1)return u;
return frs(id,l,r,d,mid+1,en,(x<<1)|1);
}
int lst(int id,int l,int r,int d,int st,int en,int x=1)
{
if(st>r||en<l)return -1;
if(sg[id][x]<d)return -1;
if(st==en)return st;
int mid=(st+en)>>1;
int u=lst(id,l,r,d,mid+1,en,(x<<1)|1);
if(u!=-1)return u;
return lst(id,l,r,d,st,mid,(x<<1));
}
int cal(int id,int l,int r,int st,int en,int x=1)
{
if(st>r|| en<l)return 0;
if(st>=l && en<=r)return sg[id][x];
int mid=(st+en)/2;
return max(cal(id,l,r,st,mid,(x<<1)),cal(id,l,r,mid+1,en,(x<<1)|1));
}
void build(int id,vector<int>&v,int st,int en,int x=1)
{
if(st==en){sg[id][x]=v[st];return;}
int mid=(st+en)>>1;
build(id,v,st,mid,(x<<1));
build(id,v,mid+1,en,(x<<1)|1);
sg[id][x]=max(sg[id][(x<<1)],sg[id][(x<<1)|1]);
}
int sz;
void init(int N,vector<int> H)
{
sz=N;
build(0,H,0,N-1);
stack<int>st;
vector<int>g;
for(int i=0;i<N;i++)
{
while((!st.empty())&&(H[st.top()]>H[i]))st.pop();
if(st.empty() ){g.push_back(inf);st.push(i);continue;}
if(st.top()==i-1){g.push_back(0);st.push(i);continue;}
int u=cal(0,st.top()+1,i-1,0,N-1);
g.push_back(u-H[i]);
st.push(i);
}
vector<int>f;
while(!st.empty())st.pop();
for(int i=N-1;i>=0;i--)
{
while((!st.empty())&&(H[st.top()]>H[i]))st.pop();
if(st.empty() ){f.push_back(inf);st.push(i);continue;}
if( st.top()==i+1){f.push_back(0);st.push(i);continue;}
int u=cal(0,i+1,st.top()-1,0,N-1);
f.push_back(u-H[i]);
st.push(i);
}
reverse(f.begin(),f.end());
build(1,f,0,N-1);
build(2,g,0,N-1);
// for(int i=0;i<N;i++)
// cout<<i<<" "<<f[i]<<" "<<g[i]<<endl;
prs[0]=empt;
for(int i=0;i<N;i++)
prs[i+1]=insert(prs[i],min(f[i],g[i]));
}
int max_towers(int L,int R,int D)
{
if(L==R)return 1;
if(L==R-1)return 1;
int u=frs(1,L,R,D,0,sz-1);
int v=lst(2,L,R,D,0,sz-1);
if(u==-1 || v==-1 || u>v)return 1;
int ans=2+cal(prs[v],prs[u+1],D,inf);
return ans;
}
/*
int main()
{
init(9,{1,2,3,4,10,9,8,7,6});
int l,r,d;
while(cin>>l>>r>>d)
{
cout<<max_towers(l,r,d)<<endl;
}
return 0;
}
*/
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
500 ms |
61052 KB |
Output is correct |
2 |
Correct |
896 ms |
102804 KB |
Output is correct |
3 |
Correct |
1055 ms |
102696 KB |
Output is correct |
4 |
Correct |
1026 ms |
102812 KB |
Output is correct |
5 |
Correct |
982 ms |
103104 KB |
Output is correct |
6 |
Correct |
838 ms |
102720 KB |
Output is correct |
7 |
Correct |
629 ms |
103156 KB |
Output is correct |
8 |
Correct |
0 ms |
208 KB |
Output is correct |
9 |
Correct |
3 ms |
2256 KB |
Output is correct |
10 |
Correct |
3 ms |
2256 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
720 KB |
Output is correct |
2 |
Correct |
6 ms |
2256 KB |
Output is correct |
3 |
Correct |
3 ms |
2256 KB |
Output is correct |
4 |
Correct |
6 ms |
2276 KB |
Output is correct |
5 |
Correct |
5 ms |
2280 KB |
Output is correct |
6 |
Correct |
4 ms |
2256 KB |
Output is correct |
7 |
Correct |
4 ms |
2256 KB |
Output is correct |
8 |
Correct |
3 ms |
2348 KB |
Output is correct |
9 |
Correct |
3 ms |
2256 KB |
Output is correct |
10 |
Correct |
3 ms |
2256 KB |
Output is correct |
11 |
Correct |
3 ms |
2256 KB |
Output is correct |
12 |
Correct |
0 ms |
336 KB |
Output is correct |
13 |
Correct |
4 ms |
2256 KB |
Output is correct |
14 |
Correct |
3 ms |
2256 KB |
Output is correct |
15 |
Correct |
3 ms |
2256 KB |
Output is correct |
16 |
Correct |
3 ms |
2256 KB |
Output is correct |
17 |
Correct |
3 ms |
2256 KB |
Output is correct |
18 |
Correct |
3 ms |
2256 KB |
Output is correct |
19 |
Correct |
3 ms |
2256 KB |
Output is correct |
20 |
Correct |
3 ms |
2256 KB |
Output is correct |
21 |
Correct |
3 ms |
2256 KB |
Output is correct |
22 |
Correct |
3 ms |
2256 KB |
Output is correct |
23 |
Correct |
3 ms |
2256 KB |
Output is correct |
24 |
Correct |
5 ms |
2256 KB |
Output is correct |
25 |
Correct |
2 ms |
1232 KB |
Output is correct |
26 |
Correct |
3 ms |
2256 KB |
Output is correct |
27 |
Correct |
3 ms |
2324 KB |
Output is correct |
28 |
Correct |
3 ms |
2256 KB |
Output is correct |
29 |
Correct |
4 ms |
2256 KB |
Output is correct |
30 |
Correct |
3 ms |
2256 KB |
Output is correct |
31 |
Correct |
3 ms |
2256 KB |
Output is correct |
32 |
Correct |
3 ms |
2256 KB |
Output is correct |
33 |
Correct |
3 ms |
2256 KB |
Output is correct |
34 |
Correct |
3 ms |
2256 KB |
Output is correct |
35 |
Correct |
4 ms |
2256 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
720 KB |
Output is correct |
2 |
Correct |
6 ms |
2256 KB |
Output is correct |
3 |
Correct |
3 ms |
2256 KB |
Output is correct |
4 |
Correct |
6 ms |
2276 KB |
Output is correct |
5 |
Correct |
5 ms |
2280 KB |
Output is correct |
6 |
Correct |
4 ms |
2256 KB |
Output is correct |
7 |
Correct |
4 ms |
2256 KB |
Output is correct |
8 |
Correct |
3 ms |
2348 KB |
Output is correct |
9 |
Correct |
3 ms |
2256 KB |
Output is correct |
10 |
Correct |
3 ms |
2256 KB |
Output is correct |
11 |
Correct |
3 ms |
2256 KB |
Output is correct |
12 |
Correct |
0 ms |
336 KB |
Output is correct |
13 |
Correct |
4 ms |
2256 KB |
Output is correct |
14 |
Correct |
3 ms |
2256 KB |
Output is correct |
15 |
Correct |
3 ms |
2256 KB |
Output is correct |
16 |
Correct |
3 ms |
2256 KB |
Output is correct |
17 |
Correct |
3 ms |
2256 KB |
Output is correct |
18 |
Correct |
3 ms |
2256 KB |
Output is correct |
19 |
Correct |
3 ms |
2256 KB |
Output is correct |
20 |
Correct |
3 ms |
2256 KB |
Output is correct |
21 |
Correct |
3 ms |
2256 KB |
Output is correct |
22 |
Correct |
3 ms |
2256 KB |
Output is correct |
23 |
Correct |
3 ms |
2256 KB |
Output is correct |
24 |
Correct |
5 ms |
2256 KB |
Output is correct |
25 |
Correct |
2 ms |
1232 KB |
Output is correct |
26 |
Correct |
3 ms |
2256 KB |
Output is correct |
27 |
Correct |
3 ms |
2324 KB |
Output is correct |
28 |
Correct |
3 ms |
2256 KB |
Output is correct |
29 |
Correct |
4 ms |
2256 KB |
Output is correct |
30 |
Correct |
3 ms |
2256 KB |
Output is correct |
31 |
Correct |
3 ms |
2256 KB |
Output is correct |
32 |
Correct |
3 ms |
2256 KB |
Output is correct |
33 |
Correct |
3 ms |
2256 KB |
Output is correct |
34 |
Correct |
3 ms |
2256 KB |
Output is correct |
35 |
Correct |
4 ms |
2256 KB |
Output is correct |
36 |
Correct |
98 ms |
66456 KB |
Output is correct |
37 |
Correct |
157 ms |
102776 KB |
Output is correct |
38 |
Correct |
162 ms |
102628 KB |
Output is correct |
39 |
Correct |
164 ms |
102628 KB |
Output is correct |
40 |
Correct |
178 ms |
102592 KB |
Output is correct |
41 |
Correct |
185 ms |
102732 KB |
Output is correct |
42 |
Correct |
163 ms |
102596 KB |
Output is correct |
43 |
Correct |
124 ms |
102696 KB |
Output is correct |
44 |
Correct |
129 ms |
103200 KB |
Output is correct |
45 |
Correct |
133 ms |
102732 KB |
Output is correct |
46 |
Correct |
130 ms |
103040 KB |
Output is correct |
47 |
Correct |
164 ms |
102640 KB |
Output is correct |
48 |
Correct |
166 ms |
102584 KB |
Output is correct |
49 |
Correct |
158 ms |
102592 KB |
Output is correct |
50 |
Correct |
123 ms |
103192 KB |
Output is correct |
51 |
Correct |
124 ms |
102812 KB |
Output is correct |
52 |
Correct |
181 ms |
102688 KB |
Output is correct |
53 |
Correct |
171 ms |
102584 KB |
Output is correct |
54 |
Correct |
159 ms |
102596 KB |
Output is correct |
55 |
Correct |
121 ms |
103216 KB |
Output is correct |
56 |
Correct |
170 ms |
102752 KB |
Output is correct |
57 |
Correct |
153 ms |
99268 KB |
Output is correct |
58 |
Correct |
158 ms |
102684 KB |
Output is correct |
59 |
Correct |
150 ms |
102620 KB |
Output is correct |
60 |
Correct |
165 ms |
102668 KB |
Output is correct |
61 |
Correct |
190 ms |
102568 KB |
Output is correct |
62 |
Correct |
157 ms |
102584 KB |
Output is correct |
63 |
Correct |
164 ms |
102732 KB |
Output is correct |
64 |
Correct |
125 ms |
102808 KB |
Output is correct |
65 |
Correct |
151 ms |
103200 KB |
Output is correct |
66 |
Correct |
148 ms |
102804 KB |
Output is correct |
67 |
Correct |
122 ms |
103156 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
860 ms |
101992 KB |
Output is correct |
2 |
Correct |
1068 ms |
102724 KB |
Output is correct |
3 |
Correct |
1238 ms |
102688 KB |
Output is correct |
4 |
Correct |
1163 ms |
102588 KB |
Output is correct |
5 |
Correct |
1190 ms |
102680 KB |
Output is correct |
6 |
Correct |
1237 ms |
102684 KB |
Output is correct |
7 |
Correct |
1403 ms |
102588 KB |
Output is correct |
8 |
Correct |
1287 ms |
102784 KB |
Output is correct |
9 |
Correct |
1355 ms |
103096 KB |
Output is correct |
10 |
Correct |
1210 ms |
102732 KB |
Output is correct |
11 |
Correct |
1157 ms |
102900 KB |
Output is correct |
12 |
Correct |
1422 ms |
102784 KB |
Output is correct |
13 |
Correct |
1035 ms |
103176 KB |
Output is correct |
14 |
Correct |
0 ms |
208 KB |
Output is correct |
15 |
Correct |
5 ms |
2292 KB |
Output is correct |
16 |
Correct |
4 ms |
2296 KB |
Output is correct |
17 |
Correct |
197 ms |
102724 KB |
Output is correct |
18 |
Correct |
172 ms |
102668 KB |
Output is correct |
19 |
Correct |
203 ms |
102644 KB |
Output is correct |
20 |
Correct |
143 ms |
103140 KB |
Output is correct |
21 |
Correct |
134 ms |
102692 KB |
Output is correct |
22 |
Correct |
175 ms |
102600 KB |
Output is correct |
23 |
Correct |
201 ms |
102572 KB |
Output is correct |
24 |
Correct |
168 ms |
102640 KB |
Output is correct |
25 |
Correct |
138 ms |
103108 KB |
Output is correct |
26 |
Correct |
153 ms |
102724 KB |
Output is correct |
27 |
Correct |
5 ms |
2308 KB |
Output is correct |
28 |
Correct |
3 ms |
2256 KB |
Output is correct |
29 |
Correct |
4 ms |
2256 KB |
Output is correct |
30 |
Correct |
3 ms |
2256 KB |
Output is correct |
31 |
Correct |
3 ms |
2256 KB |
Output is correct |
32 |
Correct |
4 ms |
2280 KB |
Output is correct |
33 |
Correct |
4 ms |
2256 KB |
Output is correct |
34 |
Correct |
5 ms |
2296 KB |
Output is correct |
35 |
Correct |
3 ms |
2256 KB |
Output is correct |
36 |
Correct |
3 ms |
2256 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
359 ms |
24748 KB |
Output is correct |
2 |
Correct |
1016 ms |
102716 KB |
Output is correct |
3 |
Correct |
1147 ms |
102672 KB |
Output is correct |
4 |
Correct |
1288 ms |
102692 KB |
Output is correct |
5 |
Correct |
1135 ms |
102636 KB |
Output is correct |
6 |
Correct |
1290 ms |
102616 KB |
Output is correct |
7 |
Correct |
1163 ms |
102572 KB |
Output is correct |
8 |
Correct |
984 ms |
102812 KB |
Output is correct |
9 |
Correct |
1040 ms |
103232 KB |
Output is correct |
10 |
Correct |
989 ms |
102732 KB |
Output is correct |
11 |
Correct |
1049 ms |
102828 KB |
Output is correct |
12 |
Correct |
155 ms |
102632 KB |
Output is correct |
13 |
Correct |
168 ms |
102572 KB |
Output is correct |
14 |
Correct |
158 ms |
102592 KB |
Output is correct |
15 |
Correct |
122 ms |
103176 KB |
Output is correct |
16 |
Correct |
133 ms |
102760 KB |
Output is correct |
17 |
Correct |
152 ms |
99276 KB |
Output is correct |
18 |
Correct |
167 ms |
102732 KB |
Output is correct |
19 |
Correct |
150 ms |
102716 KB |
Output is correct |
20 |
Correct |
168 ms |
102624 KB |
Output is correct |
21 |
Correct |
173 ms |
102644 KB |
Output is correct |
22 |
Correct |
160 ms |
102572 KB |
Output is correct |
23 |
Correct |
170 ms |
102608 KB |
Output is correct |
24 |
Correct |
125 ms |
102692 KB |
Output is correct |
25 |
Correct |
133 ms |
103172 KB |
Output is correct |
26 |
Correct |
132 ms |
102792 KB |
Output is correct |
27 |
Correct |
124 ms |
103196 KB |
Output is correct |
28 |
Correct |
3 ms |
2256 KB |
Output is correct |
29 |
Correct |
4 ms |
2256 KB |
Output is correct |
30 |
Correct |
3 ms |
2256 KB |
Output is correct |
31 |
Correct |
3 ms |
2256 KB |
Output is correct |
32 |
Correct |
3 ms |
2256 KB |
Output is correct |
33 |
Correct |
2 ms |
1232 KB |
Output is correct |
34 |
Correct |
3 ms |
2256 KB |
Output is correct |
35 |
Correct |
3 ms |
2352 KB |
Output is correct |
36 |
Correct |
4 ms |
2256 KB |
Output is correct |
37 |
Correct |
3 ms |
2256 KB |
Output is correct |
38 |
Correct |
3 ms |
2252 KB |
Output is correct |
39 |
Correct |
3 ms |
2256 KB |
Output is correct |
40 |
Correct |
3 ms |
2256 KB |
Output is correct |
41 |
Correct |
3 ms |
2256 KB |
Output is correct |
42 |
Correct |
3 ms |
2256 KB |
Output is correct |
43 |
Correct |
4 ms |
2296 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
720 KB |
Output is correct |
2 |
Correct |
6 ms |
2256 KB |
Output is correct |
3 |
Correct |
3 ms |
2256 KB |
Output is correct |
4 |
Correct |
6 ms |
2276 KB |
Output is correct |
5 |
Correct |
5 ms |
2280 KB |
Output is correct |
6 |
Correct |
4 ms |
2256 KB |
Output is correct |
7 |
Correct |
4 ms |
2256 KB |
Output is correct |
8 |
Correct |
3 ms |
2348 KB |
Output is correct |
9 |
Correct |
3 ms |
2256 KB |
Output is correct |
10 |
Correct |
3 ms |
2256 KB |
Output is correct |
11 |
Correct |
3 ms |
2256 KB |
Output is correct |
12 |
Correct |
0 ms |
336 KB |
Output is correct |
13 |
Correct |
4 ms |
2256 KB |
Output is correct |
14 |
Correct |
3 ms |
2256 KB |
Output is correct |
15 |
Correct |
3 ms |
2256 KB |
Output is correct |
16 |
Correct |
3 ms |
2256 KB |
Output is correct |
17 |
Correct |
3 ms |
2256 KB |
Output is correct |
18 |
Correct |
3 ms |
2256 KB |
Output is correct |
19 |
Correct |
3 ms |
2256 KB |
Output is correct |
20 |
Correct |
3 ms |
2256 KB |
Output is correct |
21 |
Correct |
3 ms |
2256 KB |
Output is correct |
22 |
Correct |
3 ms |
2256 KB |
Output is correct |
23 |
Correct |
3 ms |
2256 KB |
Output is correct |
24 |
Correct |
5 ms |
2256 KB |
Output is correct |
25 |
Correct |
2 ms |
1232 KB |
Output is correct |
26 |
Correct |
3 ms |
2256 KB |
Output is correct |
27 |
Correct |
3 ms |
2324 KB |
Output is correct |
28 |
Correct |
3 ms |
2256 KB |
Output is correct |
29 |
Correct |
4 ms |
2256 KB |
Output is correct |
30 |
Correct |
3 ms |
2256 KB |
Output is correct |
31 |
Correct |
3 ms |
2256 KB |
Output is correct |
32 |
Correct |
3 ms |
2256 KB |
Output is correct |
33 |
Correct |
3 ms |
2256 KB |
Output is correct |
34 |
Correct |
3 ms |
2256 KB |
Output is correct |
35 |
Correct |
4 ms |
2256 KB |
Output is correct |
36 |
Correct |
98 ms |
66456 KB |
Output is correct |
37 |
Correct |
157 ms |
102776 KB |
Output is correct |
38 |
Correct |
162 ms |
102628 KB |
Output is correct |
39 |
Correct |
164 ms |
102628 KB |
Output is correct |
40 |
Correct |
178 ms |
102592 KB |
Output is correct |
41 |
Correct |
185 ms |
102732 KB |
Output is correct |
42 |
Correct |
163 ms |
102596 KB |
Output is correct |
43 |
Correct |
124 ms |
102696 KB |
Output is correct |
44 |
Correct |
129 ms |
103200 KB |
Output is correct |
45 |
Correct |
133 ms |
102732 KB |
Output is correct |
46 |
Correct |
130 ms |
103040 KB |
Output is correct |
47 |
Correct |
164 ms |
102640 KB |
Output is correct |
48 |
Correct |
166 ms |
102584 KB |
Output is correct |
49 |
Correct |
158 ms |
102592 KB |
Output is correct |
50 |
Correct |
123 ms |
103192 KB |
Output is correct |
51 |
Correct |
124 ms |
102812 KB |
Output is correct |
52 |
Correct |
181 ms |
102688 KB |
Output is correct |
53 |
Correct |
171 ms |
102584 KB |
Output is correct |
54 |
Correct |
159 ms |
102596 KB |
Output is correct |
55 |
Correct |
121 ms |
103216 KB |
Output is correct |
56 |
Correct |
170 ms |
102752 KB |
Output is correct |
57 |
Correct |
153 ms |
99268 KB |
Output is correct |
58 |
Correct |
158 ms |
102684 KB |
Output is correct |
59 |
Correct |
150 ms |
102620 KB |
Output is correct |
60 |
Correct |
165 ms |
102668 KB |
Output is correct |
61 |
Correct |
190 ms |
102568 KB |
Output is correct |
62 |
Correct |
157 ms |
102584 KB |
Output is correct |
63 |
Correct |
164 ms |
102732 KB |
Output is correct |
64 |
Correct |
125 ms |
102808 KB |
Output is correct |
65 |
Correct |
151 ms |
103200 KB |
Output is correct |
66 |
Correct |
148 ms |
102804 KB |
Output is correct |
67 |
Correct |
122 ms |
103156 KB |
Output is correct |
68 |
Correct |
860 ms |
101992 KB |
Output is correct |
69 |
Correct |
1068 ms |
102724 KB |
Output is correct |
70 |
Correct |
1238 ms |
102688 KB |
Output is correct |
71 |
Correct |
1163 ms |
102588 KB |
Output is correct |
72 |
Correct |
1190 ms |
102680 KB |
Output is correct |
73 |
Correct |
1237 ms |
102684 KB |
Output is correct |
74 |
Correct |
1403 ms |
102588 KB |
Output is correct |
75 |
Correct |
1287 ms |
102784 KB |
Output is correct |
76 |
Correct |
1355 ms |
103096 KB |
Output is correct |
77 |
Correct |
1210 ms |
102732 KB |
Output is correct |
78 |
Correct |
1157 ms |
102900 KB |
Output is correct |
79 |
Correct |
1422 ms |
102784 KB |
Output is correct |
80 |
Correct |
1035 ms |
103176 KB |
Output is correct |
81 |
Correct |
0 ms |
208 KB |
Output is correct |
82 |
Correct |
5 ms |
2292 KB |
Output is correct |
83 |
Correct |
4 ms |
2296 KB |
Output is correct |
84 |
Correct |
197 ms |
102724 KB |
Output is correct |
85 |
Correct |
172 ms |
102668 KB |
Output is correct |
86 |
Correct |
203 ms |
102644 KB |
Output is correct |
87 |
Correct |
143 ms |
103140 KB |
Output is correct |
88 |
Correct |
134 ms |
102692 KB |
Output is correct |
89 |
Correct |
175 ms |
102600 KB |
Output is correct |
90 |
Correct |
201 ms |
102572 KB |
Output is correct |
91 |
Correct |
168 ms |
102640 KB |
Output is correct |
92 |
Correct |
138 ms |
103108 KB |
Output is correct |
93 |
Correct |
153 ms |
102724 KB |
Output is correct |
94 |
Correct |
5 ms |
2308 KB |
Output is correct |
95 |
Correct |
3 ms |
2256 KB |
Output is correct |
96 |
Correct |
4 ms |
2256 KB |
Output is correct |
97 |
Correct |
3 ms |
2256 KB |
Output is correct |
98 |
Correct |
3 ms |
2256 KB |
Output is correct |
99 |
Correct |
4 ms |
2280 KB |
Output is correct |
100 |
Correct |
4 ms |
2256 KB |
Output is correct |
101 |
Correct |
5 ms |
2296 KB |
Output is correct |
102 |
Correct |
3 ms |
2256 KB |
Output is correct |
103 |
Correct |
3 ms |
2256 KB |
Output is correct |
104 |
Correct |
990 ms |
91512 KB |
Output is correct |
105 |
Correct |
1152 ms |
102700 KB |
Output is correct |
106 |
Correct |
1171 ms |
102600 KB |
Output is correct |
107 |
Correct |
1148 ms |
102672 KB |
Output is correct |
108 |
Correct |
1351 ms |
102704 KB |
Output is correct |
109 |
Correct |
1350 ms |
102660 KB |
Output is correct |
110 |
Correct |
1205 ms |
102584 KB |
Output is correct |
111 |
Correct |
788 ms |
102720 KB |
Output is correct |
112 |
Correct |
1061 ms |
103208 KB |
Output is correct |
113 |
Correct |
1099 ms |
102808 KB |
Output is correct |
114 |
Correct |
897 ms |
102944 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
500 ms |
61052 KB |
Output is correct |
2 |
Correct |
896 ms |
102804 KB |
Output is correct |
3 |
Correct |
1055 ms |
102696 KB |
Output is correct |
4 |
Correct |
1026 ms |
102812 KB |
Output is correct |
5 |
Correct |
982 ms |
103104 KB |
Output is correct |
6 |
Correct |
838 ms |
102720 KB |
Output is correct |
7 |
Correct |
629 ms |
103156 KB |
Output is correct |
8 |
Correct |
0 ms |
208 KB |
Output is correct |
9 |
Correct |
3 ms |
2256 KB |
Output is correct |
10 |
Correct |
3 ms |
2256 KB |
Output is correct |
11 |
Correct |
1 ms |
720 KB |
Output is correct |
12 |
Correct |
6 ms |
2256 KB |
Output is correct |
13 |
Correct |
3 ms |
2256 KB |
Output is correct |
14 |
Correct |
6 ms |
2276 KB |
Output is correct |
15 |
Correct |
5 ms |
2280 KB |
Output is correct |
16 |
Correct |
4 ms |
2256 KB |
Output is correct |
17 |
Correct |
4 ms |
2256 KB |
Output is correct |
18 |
Correct |
3 ms |
2348 KB |
Output is correct |
19 |
Correct |
3 ms |
2256 KB |
Output is correct |
20 |
Correct |
3 ms |
2256 KB |
Output is correct |
21 |
Correct |
3 ms |
2256 KB |
Output is correct |
22 |
Correct |
0 ms |
336 KB |
Output is correct |
23 |
Correct |
4 ms |
2256 KB |
Output is correct |
24 |
Correct |
3 ms |
2256 KB |
Output is correct |
25 |
Correct |
3 ms |
2256 KB |
Output is correct |
26 |
Correct |
3 ms |
2256 KB |
Output is correct |
27 |
Correct |
3 ms |
2256 KB |
Output is correct |
28 |
Correct |
3 ms |
2256 KB |
Output is correct |
29 |
Correct |
3 ms |
2256 KB |
Output is correct |
30 |
Correct |
3 ms |
2256 KB |
Output is correct |
31 |
Correct |
3 ms |
2256 KB |
Output is correct |
32 |
Correct |
3 ms |
2256 KB |
Output is correct |
33 |
Correct |
3 ms |
2256 KB |
Output is correct |
34 |
Correct |
5 ms |
2256 KB |
Output is correct |
35 |
Correct |
2 ms |
1232 KB |
Output is correct |
36 |
Correct |
3 ms |
2256 KB |
Output is correct |
37 |
Correct |
3 ms |
2324 KB |
Output is correct |
38 |
Correct |
3 ms |
2256 KB |
Output is correct |
39 |
Correct |
4 ms |
2256 KB |
Output is correct |
40 |
Correct |
3 ms |
2256 KB |
Output is correct |
41 |
Correct |
3 ms |
2256 KB |
Output is correct |
42 |
Correct |
3 ms |
2256 KB |
Output is correct |
43 |
Correct |
3 ms |
2256 KB |
Output is correct |
44 |
Correct |
3 ms |
2256 KB |
Output is correct |
45 |
Correct |
4 ms |
2256 KB |
Output is correct |
46 |
Correct |
98 ms |
66456 KB |
Output is correct |
47 |
Correct |
157 ms |
102776 KB |
Output is correct |
48 |
Correct |
162 ms |
102628 KB |
Output is correct |
49 |
Correct |
164 ms |
102628 KB |
Output is correct |
50 |
Correct |
178 ms |
102592 KB |
Output is correct |
51 |
Correct |
185 ms |
102732 KB |
Output is correct |
52 |
Correct |
163 ms |
102596 KB |
Output is correct |
53 |
Correct |
124 ms |
102696 KB |
Output is correct |
54 |
Correct |
129 ms |
103200 KB |
Output is correct |
55 |
Correct |
133 ms |
102732 KB |
Output is correct |
56 |
Correct |
130 ms |
103040 KB |
Output is correct |
57 |
Correct |
164 ms |
102640 KB |
Output is correct |
58 |
Correct |
166 ms |
102584 KB |
Output is correct |
59 |
Correct |
158 ms |
102592 KB |
Output is correct |
60 |
Correct |
123 ms |
103192 KB |
Output is correct |
61 |
Correct |
124 ms |
102812 KB |
Output is correct |
62 |
Correct |
181 ms |
102688 KB |
Output is correct |
63 |
Correct |
171 ms |
102584 KB |
Output is correct |
64 |
Correct |
159 ms |
102596 KB |
Output is correct |
65 |
Correct |
121 ms |
103216 KB |
Output is correct |
66 |
Correct |
170 ms |
102752 KB |
Output is correct |
67 |
Correct |
153 ms |
99268 KB |
Output is correct |
68 |
Correct |
158 ms |
102684 KB |
Output is correct |
69 |
Correct |
150 ms |
102620 KB |
Output is correct |
70 |
Correct |
165 ms |
102668 KB |
Output is correct |
71 |
Correct |
190 ms |
102568 KB |
Output is correct |
72 |
Correct |
157 ms |
102584 KB |
Output is correct |
73 |
Correct |
164 ms |
102732 KB |
Output is correct |
74 |
Correct |
125 ms |
102808 KB |
Output is correct |
75 |
Correct |
151 ms |
103200 KB |
Output is correct |
76 |
Correct |
148 ms |
102804 KB |
Output is correct |
77 |
Correct |
122 ms |
103156 KB |
Output is correct |
78 |
Correct |
860 ms |
101992 KB |
Output is correct |
79 |
Correct |
1068 ms |
102724 KB |
Output is correct |
80 |
Correct |
1238 ms |
102688 KB |
Output is correct |
81 |
Correct |
1163 ms |
102588 KB |
Output is correct |
82 |
Correct |
1190 ms |
102680 KB |
Output is correct |
83 |
Correct |
1237 ms |
102684 KB |
Output is correct |
84 |
Correct |
1403 ms |
102588 KB |
Output is correct |
85 |
Correct |
1287 ms |
102784 KB |
Output is correct |
86 |
Correct |
1355 ms |
103096 KB |
Output is correct |
87 |
Correct |
1210 ms |
102732 KB |
Output is correct |
88 |
Correct |
1157 ms |
102900 KB |
Output is correct |
89 |
Correct |
1422 ms |
102784 KB |
Output is correct |
90 |
Correct |
1035 ms |
103176 KB |
Output is correct |
91 |
Correct |
0 ms |
208 KB |
Output is correct |
92 |
Correct |
5 ms |
2292 KB |
Output is correct |
93 |
Correct |
4 ms |
2296 KB |
Output is correct |
94 |
Correct |
197 ms |
102724 KB |
Output is correct |
95 |
Correct |
172 ms |
102668 KB |
Output is correct |
96 |
Correct |
203 ms |
102644 KB |
Output is correct |
97 |
Correct |
143 ms |
103140 KB |
Output is correct |
98 |
Correct |
134 ms |
102692 KB |
Output is correct |
99 |
Correct |
175 ms |
102600 KB |
Output is correct |
100 |
Correct |
201 ms |
102572 KB |
Output is correct |
101 |
Correct |
168 ms |
102640 KB |
Output is correct |
102 |
Correct |
138 ms |
103108 KB |
Output is correct |
103 |
Correct |
153 ms |
102724 KB |
Output is correct |
104 |
Correct |
5 ms |
2308 KB |
Output is correct |
105 |
Correct |
3 ms |
2256 KB |
Output is correct |
106 |
Correct |
4 ms |
2256 KB |
Output is correct |
107 |
Correct |
3 ms |
2256 KB |
Output is correct |
108 |
Correct |
3 ms |
2256 KB |
Output is correct |
109 |
Correct |
4 ms |
2280 KB |
Output is correct |
110 |
Correct |
4 ms |
2256 KB |
Output is correct |
111 |
Correct |
5 ms |
2296 KB |
Output is correct |
112 |
Correct |
3 ms |
2256 KB |
Output is correct |
113 |
Correct |
3 ms |
2256 KB |
Output is correct |
114 |
Correct |
359 ms |
24748 KB |
Output is correct |
115 |
Correct |
1016 ms |
102716 KB |
Output is correct |
116 |
Correct |
1147 ms |
102672 KB |
Output is correct |
117 |
Correct |
1288 ms |
102692 KB |
Output is correct |
118 |
Correct |
1135 ms |
102636 KB |
Output is correct |
119 |
Correct |
1290 ms |
102616 KB |
Output is correct |
120 |
Correct |
1163 ms |
102572 KB |
Output is correct |
121 |
Correct |
984 ms |
102812 KB |
Output is correct |
122 |
Correct |
1040 ms |
103232 KB |
Output is correct |
123 |
Correct |
989 ms |
102732 KB |
Output is correct |
124 |
Correct |
1049 ms |
102828 KB |
Output is correct |
125 |
Correct |
155 ms |
102632 KB |
Output is correct |
126 |
Correct |
168 ms |
102572 KB |
Output is correct |
127 |
Correct |
158 ms |
102592 KB |
Output is correct |
128 |
Correct |
122 ms |
103176 KB |
Output is correct |
129 |
Correct |
133 ms |
102760 KB |
Output is correct |
130 |
Correct |
152 ms |
99276 KB |
Output is correct |
131 |
Correct |
167 ms |
102732 KB |
Output is correct |
132 |
Correct |
150 ms |
102716 KB |
Output is correct |
133 |
Correct |
168 ms |
102624 KB |
Output is correct |
134 |
Correct |
173 ms |
102644 KB |
Output is correct |
135 |
Correct |
160 ms |
102572 KB |
Output is correct |
136 |
Correct |
170 ms |
102608 KB |
Output is correct |
137 |
Correct |
125 ms |
102692 KB |
Output is correct |
138 |
Correct |
133 ms |
103172 KB |
Output is correct |
139 |
Correct |
132 ms |
102792 KB |
Output is correct |
140 |
Correct |
124 ms |
103196 KB |
Output is correct |
141 |
Correct |
3 ms |
2256 KB |
Output is correct |
142 |
Correct |
4 ms |
2256 KB |
Output is correct |
143 |
Correct |
3 ms |
2256 KB |
Output is correct |
144 |
Correct |
3 ms |
2256 KB |
Output is correct |
145 |
Correct |
3 ms |
2256 KB |
Output is correct |
146 |
Correct |
2 ms |
1232 KB |
Output is correct |
147 |
Correct |
3 ms |
2256 KB |
Output is correct |
148 |
Correct |
3 ms |
2352 KB |
Output is correct |
149 |
Correct |
4 ms |
2256 KB |
Output is correct |
150 |
Correct |
3 ms |
2256 KB |
Output is correct |
151 |
Correct |
3 ms |
2252 KB |
Output is correct |
152 |
Correct |
3 ms |
2256 KB |
Output is correct |
153 |
Correct |
3 ms |
2256 KB |
Output is correct |
154 |
Correct |
3 ms |
2256 KB |
Output is correct |
155 |
Correct |
3 ms |
2256 KB |
Output is correct |
156 |
Correct |
4 ms |
2296 KB |
Output is correct |
157 |
Correct |
990 ms |
91512 KB |
Output is correct |
158 |
Correct |
1152 ms |
102700 KB |
Output is correct |
159 |
Correct |
1171 ms |
102600 KB |
Output is correct |
160 |
Correct |
1148 ms |
102672 KB |
Output is correct |
161 |
Correct |
1351 ms |
102704 KB |
Output is correct |
162 |
Correct |
1350 ms |
102660 KB |
Output is correct |
163 |
Correct |
1205 ms |
102584 KB |
Output is correct |
164 |
Correct |
788 ms |
102720 KB |
Output is correct |
165 |
Correct |
1061 ms |
103208 KB |
Output is correct |
166 |
Correct |
1099 ms |
102808 KB |
Output is correct |
167 |
Correct |
897 ms |
102944 KB |
Output is correct |
168 |
Correct |
0 ms |
208 KB |
Output is correct |
169 |
Correct |
744 ms |
36296 KB |
Output is correct |
170 |
Correct |
1298 ms |
102620 KB |
Output is correct |
171 |
Correct |
1230 ms |
102836 KB |
Output is correct |
172 |
Correct |
1515 ms |
102668 KB |
Output is correct |
173 |
Correct |
1233 ms |
102604 KB |
Output is correct |
174 |
Correct |
1450 ms |
102596 KB |
Output is correct |
175 |
Correct |
1093 ms |
102556 KB |
Output is correct |
176 |
Correct |
1014 ms |
102748 KB |
Output is correct |
177 |
Correct |
1088 ms |
103216 KB |
Output is correct |
178 |
Correct |
1077 ms |
102708 KB |
Output is correct |
179 |
Correct |
988 ms |
102980 KB |
Output is correct |