| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 32190 | 孙喻桐 | 最长连号 | C++ | Accepted | 100 | 0 MS | 252 KB | 242 | 2022-02-10 13:58:31 |
#include<bits/stdc++.h> using namespace std; int n,a,b,t=1,ans; int main(){ cin>>n>>a; for(int i=1;i<=n;i++){ cin>>b; if(b-a==1)t++; else t=1; if(t>ans)ans=t; a=b; } if(ans==1)ans=0; cout<<ans<<endl; return 0; }