#include<iostream>#include<algorithm>#include<cstring>usingnamespace std;int n, c;int num[200001];int cnt =0;voidBinarySearch(int x,int l,int r){
while(l <= r){
int m =(l + r)>>1;if(num[m]== x){
cnt++;BinarySearch(x, l, m-1);BinarySearch(x, m+1, r);return;}elseif(num[m]< x)
l = m +1;else r = m -1;}}intmain(){
cin >> n >> c;for(int i =1; i <= n; i++)
cin >> num[