Run ID Author Problem Lang Verdict Time Memory Code Length Submit Time
54956 zhangweiran 最长平台 C++ Accepted 1 MS 248 KB 287 2024-11-01 15:31:39

Tests(1/1):


#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; }


Judgement Protocol: