Language: C++

//  Created by liszt on 2019/07/31.
#include<bits/stdc++.h>
using namespace std;

int main(){
    //input
    int n,omax,emax,o,e,i,a,b;
    vector<int> o[100001,0],e[100001,0];
    
    for(i=0;i<n/2;i++){
        cin>>a >>b;
        o[a]++; e[b]++;
        if(o[a]>omax){omax=o[a];o=a;}
        if(e[b]>emax){emax=e[b];e=b;}
    }
    
    sort(o.begin(),o.end());
    sort(e.begin(),e.end());
    
    if(o!=e){
        cout<<n-o[0]-e[0]<<endl;
        return 0;
    }
    
    cout<<min(n-o[0]-e[1],n-o[1]-e[0])<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:25: error: expected ']' before ',' token
    8 |     vector<int> o[100001,0],e[100001,0];
      |                         ^
      |                         ]
a.cc:8:26: error: expected unqualified-id before numeric constant
    8 |     vector<int> o[100001,0],e[100001,0];
      |                          ^
a.cc:12:10: error: invalid types 'int[int]' for array subscript
   12 |         o[a]++; e[b]++;
      |          ^
a.cc:12:18: error: invalid types 'int[int]' for array subscript
   12 |         o[a]++; e[b]++;
      |                  ^
a.cc:13:13: error: invalid types 'int[int]' for array subscript
   13 |         if(o[a]>omax){omax=o[a];o=a;}
      |             ^
a.cc:13:29: error: invalid types 'int[int]' for array subscript
   13 |         if(o[a]>omax){omax=o[a];o=a;}
      |                             ^
a.cc:14:13: error: invalid types 'int[int]' for array subscript
   14 |         if(e[b]>emax){emax=e[b];e=b;}
      |             ^
a.cc:14:29: error: invalid types 'int[int]' for array subscript
   14 |         if(e[b]>emax){emax=e[b];e=b;}
      |                             ^
a.cc:17:12: error: request for member 'begin' in 'o', which is of non-class type 'int'
   17 |     sort(o.begin(),o.end());
      |            ^~~~~
a.cc:17:22: error: request for member 'end' in 'o', which is of non-class type 'int'
   17 |     sort(o.begin(),o.end());
      |                      ^~~
a.cc:18:12: error: request for member 'begin' in 'e', which is of non-class type 'int'
   18 |     sort(e.begin(),e.end());
      |            ^~~~~
a.cc:18:22: error: request for member 'end' in 'e', which is of non-class type 'int'
   18 |     sort(e.begin(),e.end());
      |                      ^~~
a.cc:21:18: error: invalid types 'int[int]' for array subscript
   21 |         cout<<n-o[0]-e[0]<<endl;
      |                  ^
a.cc:21:23: error: invalid types 'int[int]' for array subscript
   21 |         cout<<n-o[0]-e[0]<<endl;
      |                       ^
a.cc:25:18: error: invalid types 'int[int]' for array subscript
   25 |     cout<<min(n-o[0]-e[1],n-o[1]-e[0])<<endl;
      |                  ^
a.cc:25:23: error: invalid types 'int[int]' for array subscript
   25 |     cout<<min(n-o[0]-e[1],n-o[1]-e[0])<<endl;
      |                       ^
a.cc:25:30: error: invalid types 'int[int]' for array subscript
   25 |     cout<<min(n-o[0]-e[1],n-o[1]-e[0])<<endl;
      |                              ^
a.cc:25:35: error: invalid types 'int[int]' for array subscript
   25 |     cout<<min(n-o[0]-e[1],n-o[1]-e[0])<<endl;
      |                                   ^