| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 32049 | 石利伟 | 最长连号 | C++ | Accepted | 100 | 0 MS | 252 KB | 320 | 2022-02-09 10:20:23 |
#include<bits/stdc++.h> using namespace std; int n,a[10010],ans; int main(){ cin>>n; for(int i=1;i<=n;i++)cin>>a[i]; for(int i=1;i<=n;i++){ int tmp=0,j=i; for(j=i+1;j<=n&&a[j]==a[j-1]+1;j++)tmp++; ans=max(ans,tmp); } ans+=1; if(ans==1)ans=0; cout<<ans; }