排什么序啊
by NaCly_Fish @ 2018-10-07 22:44:18
排了序不就整个数组都成连号了
by NaCly_Fish @ 2018-10-07 22:44:48
### ~~不会~~
by koosi @ 2018-10-07 22:57:14
```cpp
#include<bits/stdc++.h>
using namespace std;
int getint() //快读
{
char c;
int ans=0;
while(c=getchar(),c>'9' || c<'0');
while(ans=ans*10+c-'0',c=getchar(),c>='0' && c<='9');
return ans;
}
int main()
{
int n,x,y,ans=1,maxx=0;
scanf("%d",&n);
y=getint(); //上一个数
for(int i=2;i<=n;i++){
x=getint();
if(x==y+1) ans++;
else maxx=max(maxx,ans),ans=1;
y=x;
}
printf("%d\n",maxx);
return 0;
}
/*
10
3 5 6 2 3 4 5 6 8 9
ans : 5
*/
```
by bigmurmur @ 2018-10-10 12:36:19