Source Code
#include <stdio.h>

int main(){
    long long n;
    scanf("%lld",&n);
    int a[n];
    for(int i = 0; i < n; i++){
        scanf("%d",&a[i]);
    }
    long  count = 0; 
    for(int i = 0; i < n/2; i++){
        if(a[i] == a[i+1]) count ++;
        
    }
    for(int i = n-1; i > n/2; i--){
        if(a[i] == a[i-1]) count ++;
    }
    printf("%ld",count);
}
Copy
Pop Pop Ayoooy
GNU G++14
2 ms
200 KB
Wrong Answer