#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF=1e17;
typedef pair<int,int> pii;
ll n,v[100005],q,s[100005],mars[100005];
int solve(int l,int r)
{
s[l-1]=0;
mars[l-1]=0;
for(int i=l;i<=r;i++)
{
s[i]=s[i-1]+v[i];
mars[i]=0;
}
stack<int> coada;
for(int i=l;i<=r;i++)
{
while(!coada.empty()&&v[coada.top()]<v[i])
coada.pop();
int st=l-1;
if(!coada.empty())
st=coada.top();
if(s[i-1]-s[st]<v[i])
{
mars[st+1]++;
mars[i]--;
}
coada.push(i);
}
while(!coada.empty())
coada.pop();
for(int i=r;i>=l;i--)
{
while(!coada.empty()&&v[coada.top()]<v[i])
coada.pop();
int dr=r+1;
if(!coada.empty())
dr=coada.top();
if(s[dr-1]-s[i]<v[i])
{
mars[i+1]++;
mars[dr]--;
}
coada.push(i);
}
int ans=0;
for(int i=l;i<=r;i++)
{
mars[i]+=mars[i-1];
if(mars[i]==0)
ans++;
}
return ans;
}
ll aib[100005];
ll lsb(ll x)
{
return x&(-x);
}
void aibupd(ll poz,ll val)
{
for(int i=poz;i<=n;i+=lsb(i))
aib[i]+=val;
}
ll suma(ll poz)
{
ll rez=0;
for(int i=poz;i>=1;i-=lsb(i))
rez+=aib[i];
return rez;
}
struct date
{
ll minim,cnt;
} arb[4*100005];
ll toprop[4*100005];
struct prostie
{
ll maxim,poz;
} arbdir[2][4*100005]; /// 0 -> st, 1 -> dr
ll topropdir[2][4*100005];
date combine(date a, date b)
{
if(a.minim<b.minim)
return a;
if(a.minim>b.minim)
return b;
a.cnt+=b.cnt;
return a;
}
void prop(ll nod)
{
ll val=toprop[nod];
arb[nod*2].minim+=val;
arb[nod*2+1].minim+=val;
toprop[nod*2]+=val;
toprop[nod*2+1]+=val;
}
void update(ll nod,ll st,ll dr,ll a,ll b,ll val)
{
if(st!=dr)
prop(nod);
toprop[nod]=0;
if(st>=a&&dr<=b)
{
arb[nod].minim+=val;
toprop[nod]+=val;
return;
}
ll mij=(st+dr)/2;
if(a<=mij)
update(nod*2,st,mij,a,b,val);
if(b>mij)
update(nod*2+1,mij+1,dr,a,b,val);
arb[nod]=combine(arb[nod*2],arb[nod*2+1]);
}
date query(ll nod,ll st,ll dr,ll a,ll b)
{
if(st!=dr)
prop(nod);
toprop[nod]=0;
if(st>=a&&dr<=b)
return arb[nod];
date rez={2LL*INF,0};
ll mij=(st+dr)/2;
if(a<=mij)
rez=combine(rez,query(nod*2,st,mij,a,b));
if(b>mij)
rez=combine(rez,query(nod*2+1,mij+1,dr,a,b));
return rez;
}
prostie combinedir(prostie a, prostie b)
{
if(a.maxim>=b.maxim)
return a;
return b;
}
void propdir(ll ind,ll nod)
{
ll val=topropdir[ind][nod];
arbdir[ind][nod*2].maxim+=val;
arbdir[ind][nod*2+1].maxim+=val;
topropdir[ind][nod*2]+=val;
topropdir[ind][nod*2+1]+=val;
}
void updatedir(ll ind,ll nod,ll st,ll dr,ll a,ll b,ll val)
{
if(st!=dr)
propdir(ind,nod);
topropdir[ind][nod]=0;
if(st>=a&&dr<=b)
{
arbdir[ind][nod].maxim+=val;
topropdir[ind][nod]+=val;
return;
}
ll mij=(st+dr)/2;
if(a<=mij)
updatedir(ind,nod*2,st,mij,a,b,val);
if(b>mij)
updatedir(ind,nod*2+1,mij+1,dr,a,b,val);
arbdir[ind][nod]=combinedir(arbdir[ind][nod*2],arbdir[ind][nod*2+1]);
}
prostie querydir(ll ind,ll nod,ll st,ll dr,ll a,ll b)
{
if(st!=dr)
propdir(ind,nod);
topropdir[ind][nod]=0;
if(st>=a&&dr<=b)
return arbdir[ind][nod];
prostie rez={-2LL*INF,0};
ll mij=(st+dr)/2;
if(a<=mij)
rez=combinedir(rez,querydir(ind,nod*2,st,mij,a,b));
if(b>mij)
rez=combinedir(rez,querydir(ind,nod*2+1,mij+1,dr,a,b));
return rez;
}
void build(int nod,int st,int dr)
{
arb[nod].cnt=(dr-st+1);
if(st==dr)
return;
int mij=(st+dr)/2;
build(nod*2,st,mij);
build(nod*2+1,mij+1,dr);
}
void builddir(int nod,int st,int dr)
{
arbdir[0][nod]=arbdir[1][nod]={0,st};
if(st==dr)
return;
int mij=(st+dr)/2;
builddir(nod*2,st,mij);
builddir(nod*2+1,mij+1,dr);
}
set<pii> setik;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
cin>>n;
for(int i=1;i<=n;i++)
cin>>v[i];
cin>>q;
v[0]=INF;
v[n+1]=INF;
build(1,1,n);
builddir(1,1,n);
for(int i=1;i<=n;i++)
aibupd(i,v[i]);
stack<int> coada;
for(int i=1;i<=n;i++)
{
while(!coada.empty()&&v[coada.top()]<v[i])
coada.pop();
int st=0;
if(!coada.empty())
st=coada.top();
if(suma(i-1)-suma(st)<v[i])
{
/*mars[st+1]++;
mars[i]--;*/
if(st+1<=i-1)
setik.insert({st+1,i-1});
}
coada.push(i);
}
while(!coada.empty())
coada.pop();
for(int i=n;i>=1;i--)
{
while(!coada.empty()&&v[coada.top()]<v[i])
coada.pop();
int dr=n+1;
if(!coada.empty())
dr=coada.top();
if(suma(dr-1)-suma(i)<v[i])
{
/*mars[i+1]++;
mars[dr]--;*/
if(i+1<=dr-1)
setik.insert({i+1,dr-1});
}
coada.push(i);
}
while(!coada.empty())
coada.pop();
for(int i=1;i<=n;i++)
{
updatedir(0,1,1,n,i,i,v[i]);
updatedir(1,1,1,n,i,i,v[i]);
if(i+1<=n)
updatedir(0,1,1,n,i+1,n,-v[i]);
if(i-1>=1)
updatedir(1,1,1,n,1,i-1,-v[i]);
}
for(auto p:setik)
update(1,1,n,p.first,p.second,+1);
while(q--)
{
ll tip;
cin>>tip;
if(tip==1)
{
ll i,val;
cin>>i>>val;
updatedir(0,1,1,n,i,i,-v[i]);
updatedir(1,1,1,n,i,i,-v[i]);
if(i+1<=n)
updatedir(0,1,1,n,i+1,n,v[i]);
if(i-1>=1)
updatedir(1,1,1,n,1,i-1,v[i]);
aibupd(i,-v[i]);
v[i]=val;
updatedir(0,1,1,n,i,i,v[i]);
updatedir(1,1,1,n,i,i,v[i]);
if(i+1<=n)
updatedir(0,1,1,n,i+1,n,-v[i]);
if(i-1>=1)
updatedir(1,1,1,n,1,i-1,-v[i]);
aibupd(i,v[i]);
vector<int> lft,rgt;
if(i>1)
{
ll S=suma(n)-suma(i-1);
while(true)
{
prostie a=querydir(1,1,1,n,1,i-1);
a.maxim+=S;
if(a.maxim<0)
break;
lft.push_back(a.poz);
updatedir(1,1,1,n,a.poz,a.poz,-INF);
}
for(ll p:lft)
updatedir(1,1,1,n,p,p,+INF);
}
if(i+1<=n)
{
ll S=suma(i);
while(true)
{
prostie a=querydir(0,1,1,n,i+1,n);
a.maxim+=S;
if(a.maxim<0)
break;
rgt.push_back(a.poz);
updatedir(0,1,1,n,a.poz,a.poz,-INF);
}
for(ll p:rgt)
updatedir(0,1,1,n,p,p,+INF);
}
lft.push_back(i);
rgt.push_back(i);
lft.push_back(0);
rgt.push_back(n+1);
for(ll l:lft)
for(ll r:rgt)
{
ll st=l+1;
ll dr=r-1;
if(st<=dr)
{
if(suma(dr)-suma(st-1)<min(v[l],v[r]))
{
if(setik.find({st,dr})==setik.end())
{
setik.insert({st,dr});
update(1,1,n,st,dr,+1);
}
}
else
{
if(setik.find({st,dr})!=setik.end())
{
setik.erase({st,dr});
update(1,1,n,st,dr,-1);
}
}
}
}
}
else
{
int l,r;
cin>>l>>r;
ll rgt=l;
ll st=l;
ll dr=r;
ll S=suma(l-1);
while(st<=dr)
{
ll mij=(st+dr)/2;
prostie a=querydir(0,1,1,n,mij,r);
if(a.maxim+S>0)
{
rgt=mij;
st=mij+1;
}
else
dr=mij-1;
}
rgt--;
ll lft=r;
S=suma(n)-suma(r);
st=l;
dr=r;
while(st<=dr)
{
ll mij=(st+dr)/2;
prostie a=querydir(1,1,1,n,l,mij);
if(a.maxim+S>0)
{
lft=mij;
dr=mij-1;
}
else
st=mij+1;
}
lft++;
if(l<=rgt)
update(1,1,n,l,rgt,+1);
if(lft<=r)
update(1,1,n,lft,r,+1);
date rez=query(1,1,n,l,r);
if(l<=rgt)
update(1,1,n,l,rgt,-1);
if(lft<=r)
update(1,1,n,lft,r,-1);
cout<<rez.cnt<<'\n';
}
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
10584 KB |
Output is correct |
2 |
Correct |
2 ms |
10588 KB |
Output is correct |
3 |
Correct |
2 ms |
10588 KB |
Output is correct |
4 |
Correct |
1 ms |
10588 KB |
Output is correct |
5 |
Correct |
7 ms |
10588 KB |
Output is correct |
6 |
Correct |
4 ms |
10588 KB |
Output is correct |
7 |
Correct |
6 ms |
10588 KB |
Output is correct |
8 |
Correct |
5 ms |
10588 KB |
Output is correct |
9 |
Correct |
4 ms |
10588 KB |
Output is correct |
10 |
Correct |
4 ms |
10588 KB |
Output is correct |
11 |
Correct |
4 ms |
10588 KB |
Output is correct |
12 |
Correct |
5 ms |
10780 KB |
Output is correct |
13 |
Correct |
4 ms |
10588 KB |
Output is correct |
14 |
Correct |
3 ms |
10588 KB |
Output is correct |
15 |
Correct |
5 ms |
10588 KB |
Output is correct |
16 |
Correct |
5 ms |
10588 KB |
Output is correct |
17 |
Correct |
4 ms |
10588 KB |
Output is correct |
18 |
Correct |
4 ms |
10588 KB |
Output is correct |
19 |
Correct |
4 ms |
10584 KB |
Output is correct |
20 |
Correct |
4 ms |
10588 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
10584 KB |
Output is correct |
2 |
Correct |
119 ms |
32464 KB |
Output is correct |
3 |
Correct |
117 ms |
32084 KB |
Output is correct |
4 |
Correct |
120 ms |
32464 KB |
Output is correct |
5 |
Correct |
117 ms |
32212 KB |
Output is correct |
6 |
Correct |
104 ms |
30544 KB |
Output is correct |
7 |
Correct |
98 ms |
29780 KB |
Output is correct |
8 |
Correct |
104 ms |
30548 KB |
Output is correct |
9 |
Correct |
99 ms |
29780 KB |
Output is correct |
10 |
Correct |
107 ms |
30412 KB |
Output is correct |
11 |
Correct |
106 ms |
30168 KB |
Output is correct |
12 |
Correct |
101 ms |
30292 KB |
Output is correct |
13 |
Correct |
100 ms |
30380 KB |
Output is correct |
14 |
Correct |
113 ms |
31832 KB |
Output is correct |
15 |
Correct |
111 ms |
31572 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
10584 KB |
Output is correct |
2 |
Correct |
2 ms |
10588 KB |
Output is correct |
3 |
Correct |
2 ms |
10588 KB |
Output is correct |
4 |
Correct |
1 ms |
10588 KB |
Output is correct |
5 |
Correct |
7 ms |
10588 KB |
Output is correct |
6 |
Correct |
4 ms |
10588 KB |
Output is correct |
7 |
Correct |
6 ms |
10588 KB |
Output is correct |
8 |
Correct |
5 ms |
10588 KB |
Output is correct |
9 |
Correct |
4 ms |
10588 KB |
Output is correct |
10 |
Correct |
4 ms |
10588 KB |
Output is correct |
11 |
Correct |
4 ms |
10588 KB |
Output is correct |
12 |
Correct |
5 ms |
10780 KB |
Output is correct |
13 |
Correct |
4 ms |
10588 KB |
Output is correct |
14 |
Correct |
3 ms |
10588 KB |
Output is correct |
15 |
Correct |
5 ms |
10588 KB |
Output is correct |
16 |
Correct |
5 ms |
10588 KB |
Output is correct |
17 |
Correct |
4 ms |
10588 KB |
Output is correct |
18 |
Correct |
4 ms |
10588 KB |
Output is correct |
19 |
Correct |
4 ms |
10584 KB |
Output is correct |
20 |
Correct |
4 ms |
10588 KB |
Output is correct |
21 |
Correct |
1 ms |
10584 KB |
Output is correct |
22 |
Correct |
119 ms |
32464 KB |
Output is correct |
23 |
Correct |
117 ms |
32084 KB |
Output is correct |
24 |
Correct |
120 ms |
32464 KB |
Output is correct |
25 |
Correct |
117 ms |
32212 KB |
Output is correct |
26 |
Correct |
104 ms |
30544 KB |
Output is correct |
27 |
Correct |
98 ms |
29780 KB |
Output is correct |
28 |
Correct |
104 ms |
30548 KB |
Output is correct |
29 |
Correct |
99 ms |
29780 KB |
Output is correct |
30 |
Correct |
107 ms |
30412 KB |
Output is correct |
31 |
Correct |
106 ms |
30168 KB |
Output is correct |
32 |
Correct |
101 ms |
30292 KB |
Output is correct |
33 |
Correct |
100 ms |
30380 KB |
Output is correct |
34 |
Correct |
113 ms |
31832 KB |
Output is correct |
35 |
Correct |
111 ms |
31572 KB |
Output is correct |
36 |
Correct |
138 ms |
33104 KB |
Output is correct |
37 |
Correct |
137 ms |
32340 KB |
Output is correct |
38 |
Correct |
127 ms |
31828 KB |
Output is correct |
39 |
Correct |
151 ms |
33384 KB |
Output is correct |
40 |
Correct |
128 ms |
31700 KB |
Output is correct |
41 |
Correct |
114 ms |
30544 KB |
Output is correct |
42 |
Correct |
118 ms |
30548 KB |
Output is correct |
43 |
Correct |
119 ms |
30116 KB |
Output is correct |
44 |
Correct |
113 ms |
29652 KB |
Output is correct |
45 |
Correct |
141 ms |
30760 KB |
Output is correct |
46 |
Correct |
118 ms |
30552 KB |
Output is correct |
47 |
Correct |
121 ms |
29796 KB |
Output is correct |
48 |
Correct |
113 ms |
30288 KB |
Output is correct |
49 |
Correct |
115 ms |
30372 KB |
Output is correct |
50 |
Correct |
122 ms |
31824 KB |
Output is correct |
51 |
Correct |
126 ms |
31824 KB |
Output is correct |
52 |
Correct |
127 ms |
31828 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
10584 KB |
Output is correct |
2 |
Correct |
119 ms |
32464 KB |
Output is correct |
3 |
Correct |
117 ms |
32084 KB |
Output is correct |
4 |
Correct |
120 ms |
32464 KB |
Output is correct |
5 |
Correct |
117 ms |
32212 KB |
Output is correct |
6 |
Correct |
104 ms |
30544 KB |
Output is correct |
7 |
Correct |
98 ms |
29780 KB |
Output is correct |
8 |
Correct |
104 ms |
30548 KB |
Output is correct |
9 |
Correct |
99 ms |
29780 KB |
Output is correct |
10 |
Correct |
107 ms |
30412 KB |
Output is correct |
11 |
Correct |
106 ms |
30168 KB |
Output is correct |
12 |
Correct |
101 ms |
30292 KB |
Output is correct |
13 |
Correct |
100 ms |
30380 KB |
Output is correct |
14 |
Correct |
113 ms |
31832 KB |
Output is correct |
15 |
Correct |
111 ms |
31572 KB |
Output is correct |
16 |
Correct |
1 ms |
10840 KB |
Output is correct |
17 |
Correct |
1300 ms |
32752 KB |
Output is correct |
18 |
Correct |
1327 ms |
35368 KB |
Output is correct |
19 |
Correct |
1278 ms |
34452 KB |
Output is correct |
20 |
Correct |
1427 ms |
34516 KB |
Output is correct |
21 |
Correct |
1512 ms |
34264 KB |
Output is correct |
22 |
Correct |
1521 ms |
35336 KB |
Output is correct |
23 |
Correct |
1479 ms |
34232 KB |
Output is correct |
24 |
Correct |
1412 ms |
34872 KB |
Output is correct |
25 |
Correct |
1323 ms |
34412 KB |
Output is correct |
26 |
Correct |
1380 ms |
34384 KB |
Output is correct |
27 |
Correct |
1272 ms |
34012 KB |
Output is correct |
28 |
Correct |
1243 ms |
33528 KB |
Output is correct |
29 |
Correct |
1252 ms |
33632 KB |
Output is correct |
30 |
Correct |
1288 ms |
31496 KB |
Output is correct |
31 |
Correct |
1339 ms |
31640 KB |
Output is correct |
32 |
Correct |
1357 ms |
32596 KB |
Output is correct |
33 |
Correct |
1295 ms |
33484 KB |
Output is correct |
34 |
Correct |
1417 ms |
32028 KB |
Output is correct |
35 |
Correct |
1316 ms |
31632 KB |
Output is correct |
36 |
Correct |
1358 ms |
32964 KB |
Output is correct |
37 |
Correct |
1254 ms |
32272 KB |
Output is correct |
38 |
Correct |
1210 ms |
32264 KB |
Output is correct |
39 |
Correct |
1334 ms |
34428 KB |
Output is correct |
40 |
Correct |
1377 ms |
34228 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
10584 KB |
Output is correct |
2 |
Correct |
119 ms |
32464 KB |
Output is correct |
3 |
Correct |
117 ms |
32084 KB |
Output is correct |
4 |
Correct |
120 ms |
32464 KB |
Output is correct |
5 |
Correct |
117 ms |
32212 KB |
Output is correct |
6 |
Correct |
104 ms |
30544 KB |
Output is correct |
7 |
Correct |
98 ms |
29780 KB |
Output is correct |
8 |
Correct |
104 ms |
30548 KB |
Output is correct |
9 |
Correct |
99 ms |
29780 KB |
Output is correct |
10 |
Correct |
107 ms |
30412 KB |
Output is correct |
11 |
Correct |
106 ms |
30168 KB |
Output is correct |
12 |
Correct |
101 ms |
30292 KB |
Output is correct |
13 |
Correct |
100 ms |
30380 KB |
Output is correct |
14 |
Correct |
113 ms |
31832 KB |
Output is correct |
15 |
Correct |
111 ms |
31572 KB |
Output is correct |
16 |
Correct |
1 ms |
10588 KB |
Output is correct |
17 |
Correct |
1876 ms |
33180 KB |
Output is correct |
18 |
Correct |
1187 ms |
32716 KB |
Output is correct |
19 |
Correct |
1285 ms |
32488 KB |
Output is correct |
20 |
Correct |
1109 ms |
32788 KB |
Output is correct |
21 |
Correct |
1746 ms |
32848 KB |
Output is correct |
22 |
Correct |
1207 ms |
32848 KB |
Output is correct |
23 |
Correct |
1550 ms |
32600 KB |
Output is correct |
24 |
Correct |
1206 ms |
32708 KB |
Output is correct |
25 |
Correct |
1423 ms |
32280 KB |
Output is correct |
26 |
Correct |
695 ms |
31060 KB |
Output is correct |
27 |
Correct |
771 ms |
30764 KB |
Output is correct |
28 |
Correct |
950 ms |
32000 KB |
Output is correct |
29 |
Correct |
695 ms |
30724 KB |
Output is correct |
30 |
Correct |
766 ms |
30996 KB |
Output is correct |
31 |
Correct |
1104 ms |
31524 KB |
Output is correct |
32 |
Correct |
1216 ms |
31964 KB |
Output is correct |
33 |
Correct |
679 ms |
30480 KB |
Output is correct |
34 |
Correct |
1155 ms |
32244 KB |
Output is correct |
35 |
Correct |
668 ms |
30876 KB |
Output is correct |
36 |
Correct |
1098 ms |
32008 KB |
Output is correct |
37 |
Correct |
957 ms |
31940 KB |
Output is correct |
38 |
Correct |
822 ms |
31572 KB |
Output is correct |
39 |
Correct |
833 ms |
31904 KB |
Output is correct |
40 |
Correct |
684 ms |
32020 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
10584 KB |
Output is correct |
2 |
Correct |
2 ms |
10588 KB |
Output is correct |
3 |
Correct |
2 ms |
10588 KB |
Output is correct |
4 |
Correct |
1 ms |
10588 KB |
Output is correct |
5 |
Correct |
7 ms |
10588 KB |
Output is correct |
6 |
Correct |
4 ms |
10588 KB |
Output is correct |
7 |
Correct |
6 ms |
10588 KB |
Output is correct |
8 |
Correct |
5 ms |
10588 KB |
Output is correct |
9 |
Correct |
4 ms |
10588 KB |
Output is correct |
10 |
Correct |
4 ms |
10588 KB |
Output is correct |
11 |
Correct |
4 ms |
10588 KB |
Output is correct |
12 |
Correct |
5 ms |
10780 KB |
Output is correct |
13 |
Correct |
4 ms |
10588 KB |
Output is correct |
14 |
Correct |
3 ms |
10588 KB |
Output is correct |
15 |
Correct |
5 ms |
10588 KB |
Output is correct |
16 |
Correct |
5 ms |
10588 KB |
Output is correct |
17 |
Correct |
4 ms |
10588 KB |
Output is correct |
18 |
Correct |
4 ms |
10588 KB |
Output is correct |
19 |
Correct |
4 ms |
10584 KB |
Output is correct |
20 |
Correct |
4 ms |
10588 KB |
Output is correct |
21 |
Correct |
1 ms |
10584 KB |
Output is correct |
22 |
Correct |
119 ms |
32464 KB |
Output is correct |
23 |
Correct |
117 ms |
32084 KB |
Output is correct |
24 |
Correct |
120 ms |
32464 KB |
Output is correct |
25 |
Correct |
117 ms |
32212 KB |
Output is correct |
26 |
Correct |
104 ms |
30544 KB |
Output is correct |
27 |
Correct |
98 ms |
29780 KB |
Output is correct |
28 |
Correct |
104 ms |
30548 KB |
Output is correct |
29 |
Correct |
99 ms |
29780 KB |
Output is correct |
30 |
Correct |
107 ms |
30412 KB |
Output is correct |
31 |
Correct |
106 ms |
30168 KB |
Output is correct |
32 |
Correct |
101 ms |
30292 KB |
Output is correct |
33 |
Correct |
100 ms |
30380 KB |
Output is correct |
34 |
Correct |
113 ms |
31832 KB |
Output is correct |
35 |
Correct |
111 ms |
31572 KB |
Output is correct |
36 |
Correct |
138 ms |
33104 KB |
Output is correct |
37 |
Correct |
137 ms |
32340 KB |
Output is correct |
38 |
Correct |
127 ms |
31828 KB |
Output is correct |
39 |
Correct |
151 ms |
33384 KB |
Output is correct |
40 |
Correct |
128 ms |
31700 KB |
Output is correct |
41 |
Correct |
114 ms |
30544 KB |
Output is correct |
42 |
Correct |
118 ms |
30548 KB |
Output is correct |
43 |
Correct |
119 ms |
30116 KB |
Output is correct |
44 |
Correct |
113 ms |
29652 KB |
Output is correct |
45 |
Correct |
141 ms |
30760 KB |
Output is correct |
46 |
Correct |
118 ms |
30552 KB |
Output is correct |
47 |
Correct |
121 ms |
29796 KB |
Output is correct |
48 |
Correct |
113 ms |
30288 KB |
Output is correct |
49 |
Correct |
115 ms |
30372 KB |
Output is correct |
50 |
Correct |
122 ms |
31824 KB |
Output is correct |
51 |
Correct |
126 ms |
31824 KB |
Output is correct |
52 |
Correct |
127 ms |
31828 KB |
Output is correct |
53 |
Correct |
1 ms |
10840 KB |
Output is correct |
54 |
Correct |
1300 ms |
32752 KB |
Output is correct |
55 |
Correct |
1327 ms |
35368 KB |
Output is correct |
56 |
Correct |
1278 ms |
34452 KB |
Output is correct |
57 |
Correct |
1427 ms |
34516 KB |
Output is correct |
58 |
Correct |
1512 ms |
34264 KB |
Output is correct |
59 |
Correct |
1521 ms |
35336 KB |
Output is correct |
60 |
Correct |
1479 ms |
34232 KB |
Output is correct |
61 |
Correct |
1412 ms |
34872 KB |
Output is correct |
62 |
Correct |
1323 ms |
34412 KB |
Output is correct |
63 |
Correct |
1380 ms |
34384 KB |
Output is correct |
64 |
Correct |
1272 ms |
34012 KB |
Output is correct |
65 |
Correct |
1243 ms |
33528 KB |
Output is correct |
66 |
Correct |
1252 ms |
33632 KB |
Output is correct |
67 |
Correct |
1288 ms |
31496 KB |
Output is correct |
68 |
Correct |
1339 ms |
31640 KB |
Output is correct |
69 |
Correct |
1357 ms |
32596 KB |
Output is correct |
70 |
Correct |
1295 ms |
33484 KB |
Output is correct |
71 |
Correct |
1417 ms |
32028 KB |
Output is correct |
72 |
Correct |
1316 ms |
31632 KB |
Output is correct |
73 |
Correct |
1358 ms |
32964 KB |
Output is correct |
74 |
Correct |
1254 ms |
32272 KB |
Output is correct |
75 |
Correct |
1210 ms |
32264 KB |
Output is correct |
76 |
Correct |
1334 ms |
34428 KB |
Output is correct |
77 |
Correct |
1377 ms |
34228 KB |
Output is correct |
78 |
Correct |
1 ms |
10588 KB |
Output is correct |
79 |
Correct |
1876 ms |
33180 KB |
Output is correct |
80 |
Correct |
1187 ms |
32716 KB |
Output is correct |
81 |
Correct |
1285 ms |
32488 KB |
Output is correct |
82 |
Correct |
1109 ms |
32788 KB |
Output is correct |
83 |
Correct |
1746 ms |
32848 KB |
Output is correct |
84 |
Correct |
1207 ms |
32848 KB |
Output is correct |
85 |
Correct |
1550 ms |
32600 KB |
Output is correct |
86 |
Correct |
1206 ms |
32708 KB |
Output is correct |
87 |
Correct |
1423 ms |
32280 KB |
Output is correct |
88 |
Correct |
695 ms |
31060 KB |
Output is correct |
89 |
Correct |
771 ms |
30764 KB |
Output is correct |
90 |
Correct |
950 ms |
32000 KB |
Output is correct |
91 |
Correct |
695 ms |
30724 KB |
Output is correct |
92 |
Correct |
766 ms |
30996 KB |
Output is correct |
93 |
Correct |
1104 ms |
31524 KB |
Output is correct |
94 |
Correct |
1216 ms |
31964 KB |
Output is correct |
95 |
Correct |
679 ms |
30480 KB |
Output is correct |
96 |
Correct |
1155 ms |
32244 KB |
Output is correct |
97 |
Correct |
668 ms |
30876 KB |
Output is correct |
98 |
Correct |
1098 ms |
32008 KB |
Output is correct |
99 |
Correct |
957 ms |
31940 KB |
Output is correct |
100 |
Correct |
822 ms |
31572 KB |
Output is correct |
101 |
Correct |
833 ms |
31904 KB |
Output is correct |
102 |
Correct |
684 ms |
32020 KB |
Output is correct |
103 |
Correct |
1686 ms |
33360 KB |
Output is correct |
104 |
Correct |
1282 ms |
35608 KB |
Output is correct |
105 |
Correct |
1444 ms |
34420 KB |
Output is correct |
106 |
Correct |
1515 ms |
35016 KB |
Output is correct |
107 |
Correct |
1858 ms |
33908 KB |
Output is correct |
108 |
Correct |
1375 ms |
35240 KB |
Output is correct |
109 |
Correct |
1682 ms |
33848 KB |
Output is correct |
110 |
Correct |
1690 ms |
34852 KB |
Output is correct |
111 |
Correct |
1701 ms |
34520 KB |
Output is correct |
112 |
Correct |
1540 ms |
35180 KB |
Output is correct |
113 |
Correct |
1025 ms |
33452 KB |
Output is correct |
114 |
Correct |
1386 ms |
33500 KB |
Output is correct |
115 |
Correct |
1336 ms |
33556 KB |
Output is correct |
116 |
Correct |
1546 ms |
33568 KB |
Output is correct |
117 |
Correct |
1549 ms |
33592 KB |
Output is correct |
118 |
Correct |
1553 ms |
32580 KB |
Output is correct |
119 |
Correct |
818 ms |
33380 KB |
Output is correct |
120 |
Correct |
1589 ms |
33512 KB |
Output is correct |
121 |
Correct |
1500 ms |
33328 KB |
Output is correct |
122 |
Correct |
1405 ms |
33940 KB |
Output is correct |
123 |
Correct |
1181 ms |
31488 KB |
Output is correct |
124 |
Correct |
1662 ms |
33112 KB |
Output is correct |
125 |
Correct |
1430 ms |
31724 KB |
Output is correct |
126 |
Correct |
1590 ms |
32924 KB |
Output is correct |
127 |
Correct |
1269 ms |
33284 KB |
Output is correct |
128 |
Correct |
1573 ms |
32916 KB |
Output is correct |
129 |
Correct |
1185 ms |
34312 KB |
Output is correct |
130 |
Correct |
1462 ms |
34340 KB |
Output is correct |