#include "towers.h"
#include <bits/stdc++.h>
//#include "stub.cpp"
using namespace std;
typedef pair<int,int> pii;
int n;
int v[100005];
int rmq[22][100005];
int loga[100005];
int lft[100005],rgt[100005];
int tolft[100005];
int getmax(int l,int r)
{
int lg=loga[r-l+1];
return max(rmq[lg][l],rmq[lg][r-(1<<lg)+1]);
}
int getR(int poz,int delta)
{
int st=poz+2;
int dr=n;
int ans=1e9;
while(st<=dr)
{
int mij=(st+dr)/2;
if(getmax(poz+1,mij-1)-delta>=v[poz])
{
ans=mij;
dr=mij-1;
}
else
st=mij+1;
}
return ans;
}
int getL(int poz,int delta)
{
int st=1;
int dr=poz-2;
int ans=0;
while(st<=dr)
{
int mij=(st+dr)/2;
if(getmax(mij+1,poz-1)-delta>=v[poz])
{
ans=mij;
st=mij+1;
}
else
dr=mij-1;
}
return ans;
}
int bin[22][100005];
int rmin[22][100005];
int uplft[100005];
int getmin(int l,int r)
{
int lg=loga[r-l+1];
return min(rmin[lg][l],rmin[lg][r-(1<<lg)+1]);
}
bool subtask1=1;
int magic;
void init(int N, std::vector<int> H) {
n=N;
for(int i=1;i<=n;i++)
{
v[i]=H[i-1];
for(int j=0;j<=20;j++)
if((1<<j)<=i)
loga[i]=j;
}
bool cresc=1;
subtask1=1;
magic=0;
for(int i=1;i<=n;i++)
{
if(v[i]==v[i-1])
{
subtask1=0;
break;
}
if(cresc==1)
{
if(v[i]<v[i-1])
{
cresc=0;
continue;
}
}
else
{
if(v[i]>v[i-1])
{
subtask1=0;
break;
}
}
}
for(int i=n;i>=1;i--)
{
rmq[0][i]=v[i];
rmin[0][i]=v[i];
for(int j=1;j<=20;j++)
{
rmq[j][i]=rmq[j-1][i];
rmin[j][i]=rmin[j-1][i];
int poz=i+(1<<(j-1));
if(poz<=n)
{
rmq[j][i]=max(rmq[j][i],rmq[j-1][poz]);
rmin[j][i]=min(rmin[j][i],rmin[j-1][poz]);
}
}
}
if(subtask1==1)
{
int maxim=getmax(1,n);
for(int i=1;i<=n;i++)
if(v[i]==maxim)
{
magic=i;
break;
}
}
for(int i=1;i<=n;i++)
{
if(v[i]<=v[i-1])
tolft[i]=i;
else
tolft[i]=tolft[i-1];
}
for(int i=1;i<=n;i++)
{
uplft[i]=i;
if(v[i-1]>=v[i])
uplft[i]=uplft[i-1];
}
for(int i=1;i<=n;i++)
{
lft[i]=getL(i,1)+1;
lft[i]=uplft[lft[i]]-1;
lft[i]=tolft[lft[i]];
bin[0][i]=lft[i];
for(int j=1;j<=20;j++)
bin[j][i]=bin[j-1][bin[j-1][i]];
}
}
int dp[100005];
int arb[4*100005];
vector<int> add[100005];
void update(int nod,int st,int dr,int poz,int val)
{
if(st==dr)
{
arb[nod]=val;
return;
}
int mij=(st+dr)/2;
if(poz<=mij)
update(nod*2,st,mij,poz,val);
else
update(nod*2+1,mij+1,dr,poz,val);
arb[nod]=max(arb[nod*2],arb[nod*2+1]);
}
int query(int nod,int st,int dr,int a,int b)
{
if(st>=a&&dr<=b)
return arb[nod];
int mij=(st+dr)/2;
int rez=0;
if(a<=mij)
rez=max(rez,query(nod*2,st,mij,a,b));
if(b>mij)
rez=max(rez,query(nod*2+1,mij+1,dr,a,b));
return rez;
}
int max_towers(int L, int R, int D)
{
L++;
R++;
if(subtask1==1)
{
if(L<magic&&R>magic)
{
if(v[magic]-D>=max(v[L],v[R]))
return 2;
return 1;
}
return 1;
}
if(D==1)
{
int rez=1;
int nod=tolft[R];
for(int j=20;j>=0;j--)
if(bin[j][nod]>=L)
{
rez+=(1<<j);
nod=bin[j][nod];
}
int l=getL(nod,D)+1;
l=uplft[l];
int st=L;
int dr=l-1;
if(st<=dr)
{
if(getmin(st,dr)<v[l])
rez++;
}
return rez;
}
for(int i=1;i<=4*n;i++)
arb[i]=0;
for(int i=1;i<=n;i++)
add[i].clear();
int ans=1;
for(int i=L;i<=R;i++)
{
for(int j:add[i])
update(1,1,n,j,dp[j]);
dp[i]=1;
int r=getR(i,D);
int l=getL(i,D);
if(l>=L)
dp[i]=1+query(1,1,n,L,l);
ans=max(ans,dp[i]);
if(r<=R)
add[r].push_back(i);
}
//assert(dp[tolft[R]]==ans);
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
296 ms |
19168 KB |
Output is correct |
2 |
Correct |
619 ms |
30024 KB |
Output is correct |
3 |
Correct |
724 ms |
30024 KB |
Output is correct |
4 |
Correct |
814 ms |
29972 KB |
Output is correct |
5 |
Correct |
775 ms |
30032 KB |
Output is correct |
6 |
Correct |
778 ms |
30036 KB |
Output is correct |
7 |
Correct |
789 ms |
30060 KB |
Output is correct |
8 |
Correct |
1 ms |
2896 KB |
Output is correct |
9 |
Correct |
2 ms |
3408 KB |
Output is correct |
10 |
Correct |
2 ms |
3408 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
3024 KB |
Output is correct |
2 |
Correct |
2 ms |
3536 KB |
Output is correct |
3 |
Correct |
2 ms |
3536 KB |
Output is correct |
4 |
Correct |
2 ms |
3536 KB |
Output is correct |
5 |
Correct |
2 ms |
3536 KB |
Output is correct |
6 |
Correct |
2 ms |
3536 KB |
Output is correct |
7 |
Correct |
2 ms |
3536 KB |
Output is correct |
8 |
Correct |
2 ms |
3408 KB |
Output is correct |
9 |
Correct |
2 ms |
3408 KB |
Output is correct |
10 |
Correct |
2 ms |
3536 KB |
Output is correct |
11 |
Correct |
2 ms |
3536 KB |
Output is correct |
12 |
Correct |
1 ms |
2896 KB |
Output is correct |
13 |
Correct |
2 ms |
3408 KB |
Output is correct |
14 |
Correct |
2 ms |
3408 KB |
Output is correct |
15 |
Correct |
2 ms |
3408 KB |
Output is correct |
16 |
Correct |
2 ms |
3408 KB |
Output is correct |
17 |
Correct |
2 ms |
3512 KB |
Output is correct |
18 |
Correct |
2 ms |
3408 KB |
Output is correct |
19 |
Correct |
2 ms |
3468 KB |
Output is correct |
20 |
Correct |
2 ms |
3536 KB |
Output is correct |
21 |
Correct |
2 ms |
3408 KB |
Output is correct |
22 |
Correct |
2 ms |
3408 KB |
Output is correct |
23 |
Correct |
2 ms |
3408 KB |
Output is correct |
24 |
Correct |
2 ms |
3408 KB |
Output is correct |
25 |
Correct |
2 ms |
3152 KB |
Output is correct |
26 |
Correct |
2 ms |
3536 KB |
Output is correct |
27 |
Correct |
2 ms |
3536 KB |
Output is correct |
28 |
Correct |
2 ms |
3536 KB |
Output is correct |
29 |
Correct |
2 ms |
3536 KB |
Output is correct |
30 |
Correct |
2 ms |
3536 KB |
Output is correct |
31 |
Correct |
3 ms |
3568 KB |
Output is correct |
32 |
Correct |
2 ms |
3408 KB |
Output is correct |
33 |
Correct |
2 ms |
3408 KB |
Output is correct |
34 |
Correct |
2 ms |
3568 KB |
Output is correct |
35 |
Correct |
3 ms |
3540 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
3024 KB |
Output is correct |
2 |
Correct |
2 ms |
3536 KB |
Output is correct |
3 |
Correct |
2 ms |
3536 KB |
Output is correct |
4 |
Correct |
2 ms |
3536 KB |
Output is correct |
5 |
Correct |
2 ms |
3536 KB |
Output is correct |
6 |
Correct |
2 ms |
3536 KB |
Output is correct |
7 |
Correct |
2 ms |
3536 KB |
Output is correct |
8 |
Correct |
2 ms |
3408 KB |
Output is correct |
9 |
Correct |
2 ms |
3408 KB |
Output is correct |
10 |
Correct |
2 ms |
3536 KB |
Output is correct |
11 |
Correct |
2 ms |
3536 KB |
Output is correct |
12 |
Correct |
1 ms |
2896 KB |
Output is correct |
13 |
Correct |
2 ms |
3408 KB |
Output is correct |
14 |
Correct |
2 ms |
3408 KB |
Output is correct |
15 |
Correct |
2 ms |
3408 KB |
Output is correct |
16 |
Correct |
2 ms |
3408 KB |
Output is correct |
17 |
Correct |
2 ms |
3512 KB |
Output is correct |
18 |
Correct |
2 ms |
3408 KB |
Output is correct |
19 |
Correct |
2 ms |
3468 KB |
Output is correct |
20 |
Correct |
2 ms |
3536 KB |
Output is correct |
21 |
Correct |
2 ms |
3408 KB |
Output is correct |
22 |
Correct |
2 ms |
3408 KB |
Output is correct |
23 |
Correct |
2 ms |
3408 KB |
Output is correct |
24 |
Correct |
2 ms |
3408 KB |
Output is correct |
25 |
Correct |
2 ms |
3152 KB |
Output is correct |
26 |
Correct |
2 ms |
3536 KB |
Output is correct |
27 |
Correct |
2 ms |
3536 KB |
Output is correct |
28 |
Correct |
2 ms |
3536 KB |
Output is correct |
29 |
Correct |
2 ms |
3536 KB |
Output is correct |
30 |
Correct |
2 ms |
3536 KB |
Output is correct |
31 |
Correct |
3 ms |
3568 KB |
Output is correct |
32 |
Correct |
2 ms |
3408 KB |
Output is correct |
33 |
Correct |
2 ms |
3408 KB |
Output is correct |
34 |
Correct |
2 ms |
3568 KB |
Output is correct |
35 |
Correct |
3 ms |
3540 KB |
Output is correct |
36 |
Correct |
30 ms |
21832 KB |
Output is correct |
37 |
Correct |
47 ms |
31512 KB |
Output is correct |
38 |
Correct |
42 ms |
31388 KB |
Output is correct |
39 |
Correct |
41 ms |
31280 KB |
Output is correct |
40 |
Correct |
47 ms |
31428 KB |
Output is correct |
41 |
Correct |
59 ms |
32232 KB |
Output is correct |
42 |
Correct |
44 ms |
31276 KB |
Output is correct |
43 |
Correct |
34 ms |
30044 KB |
Output is correct |
44 |
Correct |
36 ms |
30056 KB |
Output is correct |
45 |
Correct |
35 ms |
31252 KB |
Output is correct |
46 |
Correct |
38 ms |
31180 KB |
Output is correct |
47 |
Correct |
41 ms |
30052 KB |
Output is correct |
48 |
Correct |
42 ms |
30068 KB |
Output is correct |
49 |
Correct |
35 ms |
30024 KB |
Output is correct |
50 |
Correct |
42 ms |
30028 KB |
Output is correct |
51 |
Correct |
33 ms |
30052 KB |
Output is correct |
52 |
Correct |
39 ms |
29960 KB |
Output is correct |
53 |
Correct |
41 ms |
30052 KB |
Output is correct |
54 |
Correct |
35 ms |
30032 KB |
Output is correct |
55 |
Correct |
37 ms |
30060 KB |
Output is correct |
56 |
Correct |
36 ms |
30032 KB |
Output is correct |
57 |
Correct |
61 ms |
31412 KB |
Output is correct |
58 |
Correct |
63 ms |
32352 KB |
Output is correct |
59 |
Correct |
67 ms |
32716 KB |
Output is correct |
60 |
Correct |
69 ms |
33180 KB |
Output is correct |
61 |
Correct |
67 ms |
32996 KB |
Output is correct |
62 |
Correct |
69 ms |
32700 KB |
Output is correct |
63 |
Correct |
69 ms |
32976 KB |
Output is correct |
64 |
Correct |
40 ms |
30052 KB |
Output is correct |
65 |
Correct |
47 ms |
30044 KB |
Output is correct |
66 |
Correct |
61 ms |
32420 KB |
Output is correct |
67 |
Correct |
53 ms |
31660 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
662 ms |
30032 KB |
Output is correct |
2 |
Correct |
846 ms |
30060 KB |
Output is correct |
3 |
Correct |
886 ms |
30000 KB |
Output is correct |
4 |
Correct |
893 ms |
30032 KB |
Output is correct |
5 |
Correct |
789 ms |
29980 KB |
Output is correct |
6 |
Correct |
883 ms |
30052 KB |
Output is correct |
7 |
Correct |
945 ms |
30024 KB |
Output is correct |
8 |
Correct |
656 ms |
30040 KB |
Output is correct |
9 |
Correct |
641 ms |
30024 KB |
Output is correct |
10 |
Correct |
723 ms |
30052 KB |
Output is correct |
11 |
Correct |
801 ms |
30024 KB |
Output is correct |
12 |
Correct |
684 ms |
30020 KB |
Output is correct |
13 |
Correct |
461 ms |
30028 KB |
Output is correct |
14 |
Correct |
1 ms |
2896 KB |
Output is correct |
15 |
Correct |
3 ms |
3408 KB |
Output is correct |
16 |
Correct |
2 ms |
3408 KB |
Output is correct |
17 |
Correct |
36 ms |
30028 KB |
Output is correct |
18 |
Correct |
41 ms |
30040 KB |
Output is correct |
19 |
Correct |
45 ms |
30044 KB |
Output is correct |
20 |
Correct |
44 ms |
29952 KB |
Output is correct |
21 |
Correct |
34 ms |
30060 KB |
Output is correct |
22 |
Correct |
38 ms |
30036 KB |
Output is correct |
23 |
Correct |
38 ms |
30048 KB |
Output is correct |
24 |
Correct |
36 ms |
30056 KB |
Output is correct |
25 |
Correct |
42 ms |
30036 KB |
Output is correct |
26 |
Correct |
48 ms |
30164 KB |
Output is correct |
27 |
Correct |
2 ms |
3408 KB |
Output is correct |
28 |
Correct |
2 ms |
3408 KB |
Output is correct |
29 |
Correct |
2 ms |
3432 KB |
Output is correct |
30 |
Correct |
2 ms |
3408 KB |
Output is correct |
31 |
Correct |
2 ms |
3408 KB |
Output is correct |
32 |
Correct |
2 ms |
3408 KB |
Output is correct |
33 |
Correct |
2 ms |
3408 KB |
Output is correct |
34 |
Correct |
2 ms |
3408 KB |
Output is correct |
35 |
Correct |
2 ms |
3408 KB |
Output is correct |
36 |
Correct |
2 ms |
3408 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
4025 ms |
10392 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
3024 KB |
Output is correct |
2 |
Correct |
2 ms |
3536 KB |
Output is correct |
3 |
Correct |
2 ms |
3536 KB |
Output is correct |
4 |
Correct |
2 ms |
3536 KB |
Output is correct |
5 |
Correct |
2 ms |
3536 KB |
Output is correct |
6 |
Correct |
2 ms |
3536 KB |
Output is correct |
7 |
Correct |
2 ms |
3536 KB |
Output is correct |
8 |
Correct |
2 ms |
3408 KB |
Output is correct |
9 |
Correct |
2 ms |
3408 KB |
Output is correct |
10 |
Correct |
2 ms |
3536 KB |
Output is correct |
11 |
Correct |
2 ms |
3536 KB |
Output is correct |
12 |
Correct |
1 ms |
2896 KB |
Output is correct |
13 |
Correct |
2 ms |
3408 KB |
Output is correct |
14 |
Correct |
2 ms |
3408 KB |
Output is correct |
15 |
Correct |
2 ms |
3408 KB |
Output is correct |
16 |
Correct |
2 ms |
3408 KB |
Output is correct |
17 |
Correct |
2 ms |
3512 KB |
Output is correct |
18 |
Correct |
2 ms |
3408 KB |
Output is correct |
19 |
Correct |
2 ms |
3468 KB |
Output is correct |
20 |
Correct |
2 ms |
3536 KB |
Output is correct |
21 |
Correct |
2 ms |
3408 KB |
Output is correct |
22 |
Correct |
2 ms |
3408 KB |
Output is correct |
23 |
Correct |
2 ms |
3408 KB |
Output is correct |
24 |
Correct |
2 ms |
3408 KB |
Output is correct |
25 |
Correct |
2 ms |
3152 KB |
Output is correct |
26 |
Correct |
2 ms |
3536 KB |
Output is correct |
27 |
Correct |
2 ms |
3536 KB |
Output is correct |
28 |
Correct |
2 ms |
3536 KB |
Output is correct |
29 |
Correct |
2 ms |
3536 KB |
Output is correct |
30 |
Correct |
2 ms |
3536 KB |
Output is correct |
31 |
Correct |
3 ms |
3568 KB |
Output is correct |
32 |
Correct |
2 ms |
3408 KB |
Output is correct |
33 |
Correct |
2 ms |
3408 KB |
Output is correct |
34 |
Correct |
2 ms |
3568 KB |
Output is correct |
35 |
Correct |
3 ms |
3540 KB |
Output is correct |
36 |
Correct |
30 ms |
21832 KB |
Output is correct |
37 |
Correct |
47 ms |
31512 KB |
Output is correct |
38 |
Correct |
42 ms |
31388 KB |
Output is correct |
39 |
Correct |
41 ms |
31280 KB |
Output is correct |
40 |
Correct |
47 ms |
31428 KB |
Output is correct |
41 |
Correct |
59 ms |
32232 KB |
Output is correct |
42 |
Correct |
44 ms |
31276 KB |
Output is correct |
43 |
Correct |
34 ms |
30044 KB |
Output is correct |
44 |
Correct |
36 ms |
30056 KB |
Output is correct |
45 |
Correct |
35 ms |
31252 KB |
Output is correct |
46 |
Correct |
38 ms |
31180 KB |
Output is correct |
47 |
Correct |
41 ms |
30052 KB |
Output is correct |
48 |
Correct |
42 ms |
30068 KB |
Output is correct |
49 |
Correct |
35 ms |
30024 KB |
Output is correct |
50 |
Correct |
42 ms |
30028 KB |
Output is correct |
51 |
Correct |
33 ms |
30052 KB |
Output is correct |
52 |
Correct |
39 ms |
29960 KB |
Output is correct |
53 |
Correct |
41 ms |
30052 KB |
Output is correct |
54 |
Correct |
35 ms |
30032 KB |
Output is correct |
55 |
Correct |
37 ms |
30060 KB |
Output is correct |
56 |
Correct |
36 ms |
30032 KB |
Output is correct |
57 |
Correct |
61 ms |
31412 KB |
Output is correct |
58 |
Correct |
63 ms |
32352 KB |
Output is correct |
59 |
Correct |
67 ms |
32716 KB |
Output is correct |
60 |
Correct |
69 ms |
33180 KB |
Output is correct |
61 |
Correct |
67 ms |
32996 KB |
Output is correct |
62 |
Correct |
69 ms |
32700 KB |
Output is correct |
63 |
Correct |
69 ms |
32976 KB |
Output is correct |
64 |
Correct |
40 ms |
30052 KB |
Output is correct |
65 |
Correct |
47 ms |
30044 KB |
Output is correct |
66 |
Correct |
61 ms |
32420 KB |
Output is correct |
67 |
Correct |
53 ms |
31660 KB |
Output is correct |
68 |
Correct |
662 ms |
30032 KB |
Output is correct |
69 |
Correct |
846 ms |
30060 KB |
Output is correct |
70 |
Correct |
886 ms |
30000 KB |
Output is correct |
71 |
Correct |
893 ms |
30032 KB |
Output is correct |
72 |
Correct |
789 ms |
29980 KB |
Output is correct |
73 |
Correct |
883 ms |
30052 KB |
Output is correct |
74 |
Correct |
945 ms |
30024 KB |
Output is correct |
75 |
Correct |
656 ms |
30040 KB |
Output is correct |
76 |
Correct |
641 ms |
30024 KB |
Output is correct |
77 |
Correct |
723 ms |
30052 KB |
Output is correct |
78 |
Correct |
801 ms |
30024 KB |
Output is correct |
79 |
Correct |
684 ms |
30020 KB |
Output is correct |
80 |
Correct |
461 ms |
30028 KB |
Output is correct |
81 |
Correct |
1 ms |
2896 KB |
Output is correct |
82 |
Correct |
3 ms |
3408 KB |
Output is correct |
83 |
Correct |
2 ms |
3408 KB |
Output is correct |
84 |
Correct |
36 ms |
30028 KB |
Output is correct |
85 |
Correct |
41 ms |
30040 KB |
Output is correct |
86 |
Correct |
45 ms |
30044 KB |
Output is correct |
87 |
Correct |
44 ms |
29952 KB |
Output is correct |
88 |
Correct |
34 ms |
30060 KB |
Output is correct |
89 |
Correct |
38 ms |
30036 KB |
Output is correct |
90 |
Correct |
38 ms |
30048 KB |
Output is correct |
91 |
Correct |
36 ms |
30056 KB |
Output is correct |
92 |
Correct |
42 ms |
30036 KB |
Output is correct |
93 |
Correct |
48 ms |
30164 KB |
Output is correct |
94 |
Correct |
2 ms |
3408 KB |
Output is correct |
95 |
Correct |
2 ms |
3408 KB |
Output is correct |
96 |
Correct |
2 ms |
3432 KB |
Output is correct |
97 |
Correct |
2 ms |
3408 KB |
Output is correct |
98 |
Correct |
2 ms |
3408 KB |
Output is correct |
99 |
Correct |
2 ms |
3408 KB |
Output is correct |
100 |
Correct |
2 ms |
3408 KB |
Output is correct |
101 |
Correct |
2 ms |
3408 KB |
Output is correct |
102 |
Correct |
2 ms |
3408 KB |
Output is correct |
103 |
Correct |
2 ms |
3408 KB |
Output is correct |
104 |
Execution timed out |
4091 ms |
29804 KB |
Time limit exceeded |
105 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
296 ms |
19168 KB |
Output is correct |
2 |
Correct |
619 ms |
30024 KB |
Output is correct |
3 |
Correct |
724 ms |
30024 KB |
Output is correct |
4 |
Correct |
814 ms |
29972 KB |
Output is correct |
5 |
Correct |
775 ms |
30032 KB |
Output is correct |
6 |
Correct |
778 ms |
30036 KB |
Output is correct |
7 |
Correct |
789 ms |
30060 KB |
Output is correct |
8 |
Correct |
1 ms |
2896 KB |
Output is correct |
9 |
Correct |
2 ms |
3408 KB |
Output is correct |
10 |
Correct |
2 ms |
3408 KB |
Output is correct |
11 |
Correct |
2 ms |
3024 KB |
Output is correct |
12 |
Correct |
2 ms |
3536 KB |
Output is correct |
13 |
Correct |
2 ms |
3536 KB |
Output is correct |
14 |
Correct |
2 ms |
3536 KB |
Output is correct |
15 |
Correct |
2 ms |
3536 KB |
Output is correct |
16 |
Correct |
2 ms |
3536 KB |
Output is correct |
17 |
Correct |
2 ms |
3536 KB |
Output is correct |
18 |
Correct |
2 ms |
3408 KB |
Output is correct |
19 |
Correct |
2 ms |
3408 KB |
Output is correct |
20 |
Correct |
2 ms |
3536 KB |
Output is correct |
21 |
Correct |
2 ms |
3536 KB |
Output is correct |
22 |
Correct |
1 ms |
2896 KB |
Output is correct |
23 |
Correct |
2 ms |
3408 KB |
Output is correct |
24 |
Correct |
2 ms |
3408 KB |
Output is correct |
25 |
Correct |
2 ms |
3408 KB |
Output is correct |
26 |
Correct |
2 ms |
3408 KB |
Output is correct |
27 |
Correct |
2 ms |
3512 KB |
Output is correct |
28 |
Correct |
2 ms |
3408 KB |
Output is correct |
29 |
Correct |
2 ms |
3468 KB |
Output is correct |
30 |
Correct |
2 ms |
3536 KB |
Output is correct |
31 |
Correct |
2 ms |
3408 KB |
Output is correct |
32 |
Correct |
2 ms |
3408 KB |
Output is correct |
33 |
Correct |
2 ms |
3408 KB |
Output is correct |
34 |
Correct |
2 ms |
3408 KB |
Output is correct |
35 |
Correct |
2 ms |
3152 KB |
Output is correct |
36 |
Correct |
2 ms |
3536 KB |
Output is correct |
37 |
Correct |
2 ms |
3536 KB |
Output is correct |
38 |
Correct |
2 ms |
3536 KB |
Output is correct |
39 |
Correct |
2 ms |
3536 KB |
Output is correct |
40 |
Correct |
2 ms |
3536 KB |
Output is correct |
41 |
Correct |
3 ms |
3568 KB |
Output is correct |
42 |
Correct |
2 ms |
3408 KB |
Output is correct |
43 |
Correct |
2 ms |
3408 KB |
Output is correct |
44 |
Correct |
2 ms |
3568 KB |
Output is correct |
45 |
Correct |
3 ms |
3540 KB |
Output is correct |
46 |
Correct |
30 ms |
21832 KB |
Output is correct |
47 |
Correct |
47 ms |
31512 KB |
Output is correct |
48 |
Correct |
42 ms |
31388 KB |
Output is correct |
49 |
Correct |
41 ms |
31280 KB |
Output is correct |
50 |
Correct |
47 ms |
31428 KB |
Output is correct |
51 |
Correct |
59 ms |
32232 KB |
Output is correct |
52 |
Correct |
44 ms |
31276 KB |
Output is correct |
53 |
Correct |
34 ms |
30044 KB |
Output is correct |
54 |
Correct |
36 ms |
30056 KB |
Output is correct |
55 |
Correct |
35 ms |
31252 KB |
Output is correct |
56 |
Correct |
38 ms |
31180 KB |
Output is correct |
57 |
Correct |
41 ms |
30052 KB |
Output is correct |
58 |
Correct |
42 ms |
30068 KB |
Output is correct |
59 |
Correct |
35 ms |
30024 KB |
Output is correct |
60 |
Correct |
42 ms |
30028 KB |
Output is correct |
61 |
Correct |
33 ms |
30052 KB |
Output is correct |
62 |
Correct |
39 ms |
29960 KB |
Output is correct |
63 |
Correct |
41 ms |
30052 KB |
Output is correct |
64 |
Correct |
35 ms |
30032 KB |
Output is correct |
65 |
Correct |
37 ms |
30060 KB |
Output is correct |
66 |
Correct |
36 ms |
30032 KB |
Output is correct |
67 |
Correct |
61 ms |
31412 KB |
Output is correct |
68 |
Correct |
63 ms |
32352 KB |
Output is correct |
69 |
Correct |
67 ms |
32716 KB |
Output is correct |
70 |
Correct |
69 ms |
33180 KB |
Output is correct |
71 |
Correct |
67 ms |
32996 KB |
Output is correct |
72 |
Correct |
69 ms |
32700 KB |
Output is correct |
73 |
Correct |
69 ms |
32976 KB |
Output is correct |
74 |
Correct |
40 ms |
30052 KB |
Output is correct |
75 |
Correct |
47 ms |
30044 KB |
Output is correct |
76 |
Correct |
61 ms |
32420 KB |
Output is correct |
77 |
Correct |
53 ms |
31660 KB |
Output is correct |
78 |
Correct |
662 ms |
30032 KB |
Output is correct |
79 |
Correct |
846 ms |
30060 KB |
Output is correct |
80 |
Correct |
886 ms |
30000 KB |
Output is correct |
81 |
Correct |
893 ms |
30032 KB |
Output is correct |
82 |
Correct |
789 ms |
29980 KB |
Output is correct |
83 |
Correct |
883 ms |
30052 KB |
Output is correct |
84 |
Correct |
945 ms |
30024 KB |
Output is correct |
85 |
Correct |
656 ms |
30040 KB |
Output is correct |
86 |
Correct |
641 ms |
30024 KB |
Output is correct |
87 |
Correct |
723 ms |
30052 KB |
Output is correct |
88 |
Correct |
801 ms |
30024 KB |
Output is correct |
89 |
Correct |
684 ms |
30020 KB |
Output is correct |
90 |
Correct |
461 ms |
30028 KB |
Output is correct |
91 |
Correct |
1 ms |
2896 KB |
Output is correct |
92 |
Correct |
3 ms |
3408 KB |
Output is correct |
93 |
Correct |
2 ms |
3408 KB |
Output is correct |
94 |
Correct |
36 ms |
30028 KB |
Output is correct |
95 |
Correct |
41 ms |
30040 KB |
Output is correct |
96 |
Correct |
45 ms |
30044 KB |
Output is correct |
97 |
Correct |
44 ms |
29952 KB |
Output is correct |
98 |
Correct |
34 ms |
30060 KB |
Output is correct |
99 |
Correct |
38 ms |
30036 KB |
Output is correct |
100 |
Correct |
38 ms |
30048 KB |
Output is correct |
101 |
Correct |
36 ms |
30056 KB |
Output is correct |
102 |
Correct |
42 ms |
30036 KB |
Output is correct |
103 |
Correct |
48 ms |
30164 KB |
Output is correct |
104 |
Correct |
2 ms |
3408 KB |
Output is correct |
105 |
Correct |
2 ms |
3408 KB |
Output is correct |
106 |
Correct |
2 ms |
3432 KB |
Output is correct |
107 |
Correct |
2 ms |
3408 KB |
Output is correct |
108 |
Correct |
2 ms |
3408 KB |
Output is correct |
109 |
Correct |
2 ms |
3408 KB |
Output is correct |
110 |
Correct |
2 ms |
3408 KB |
Output is correct |
111 |
Correct |
2 ms |
3408 KB |
Output is correct |
112 |
Correct |
2 ms |
3408 KB |
Output is correct |
113 |
Correct |
2 ms |
3408 KB |
Output is correct |
114 |
Execution timed out |
4025 ms |
10392 KB |
Time limit exceeded |
115 |
Halted |
0 ms |
0 KB |
- |