delete pics to save space
This commit is contained in:
21
1.1420.cpp
Normal file
21
1.1420.cpp
Normal file
@ -0,0 +1,21 @@
|
||||
#include<cstdio>
|
||||
#include<algorithm>
|
||||
using namespace std;
|
||||
int n,x,res,now,v;
|
||||
int main()
|
||||
{
|
||||
#ifdef local
|
||||
freopen("pro.in","r",stdin);
|
||||
#endif
|
||||
scanf("%d%d",&n,&x);
|
||||
res=now=1; v=x;
|
||||
for(int i=2;i<=n;i++)
|
||||
{
|
||||
scanf("%d",&x);
|
||||
if(x==v+1) { v=x; now++; }
|
||||
else { v=x; now=1; }
|
||||
res=max(res,now);
|
||||
}
|
||||
printf("%d\n",res);
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user