Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
9826 | jiabokai | 最长平台 | C++ | Accepted | 0 MS | 256 KB | 361 | 2023-02-17 21:30:51 |
#include<bits/stdc++.h> using namespace std; int main() { int n,a[100001]; int m=-9999,len=1; int i; cin>>n; a[0]=-3456497; for(i=1;i<=n;i++) { cin>>a[i]; if(a[i]==a[i-1]) len++; else len=1; if(len>m) m=len; } cout<<m<<endl; return 0; }