#include<bits/stdc++.h>
using namespace std;
const int maxn = 1000001;
int a[maxn];
int main(){
int n; cin >> n;
for(int i = 1; i <= n; i++) cin >> a[i];
int tmp = 1,maxx = -1;
for(int i = 1; i <= n; i++){
if(a[i] == a[i+1]) tmp++;
else{
maxx = max(tmp,maxx);
tmp = 1;
}
}
if(tmp > maxx)
maxx = tmp;
cout << maxx << endl;
return 0;
}
YBT:1116:最长平台
最新推荐文章于 2024-06-19 18:42:04 发布