1 solutions

  • 0
    @ 2024-10-6 12:14:09

    #include<stdio.h> int main(){ int i,n,a,num[1000],max=1; int cnt=1; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&a); num[i]=a; } for(i=0;i<n;i++){ if(num[i+1]==num[i])cnt++; else{ if(cnt>max)max=cnt; cnt=1; } } printf("%d",max); return 0; }

    Information

    ID
    6776
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    7
    Tags
    (None)
    # Submissions
    121
    Accepted
    31
    Uploaded By