Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
40235 | 奚晨瑞 | 最长平台 | C++ | Accepted | 0 MS | 252 KB | 287 | 2024-02-08 14:30:04 |
#include<iostream> using namespace std; int a[1000]; int main() { int x,temp; x=0; temp=1; int n; cin>>n; for(int i=0;i<n;i++){ cin>>a[i]; if(a[i]==a[i-1]){ temp++; } else{ if(temp>x){ x=temp; temp=1; } } } cout<<x; return 0; }