Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
498 B
0
Indexable
Never
#include<bits/stdc++.h>
using namespace std;

int main(){
    long long int n, count=0;
    cin >>  n;
    vector<long long int> v,v2;
    for(long long int i=0;i<n;i++){
        long long int x;
        cin >> x;
        v.push_back(x);
    }
    v2=v;
    sort(v2.begin(),v2.end());
    if(v.size()<=2){
        cout << 0;
        return 0;
    }
    for(long long int i=1;i<n;i++){
        if(v2[0]<v[i] && v[i]<v2[n-1]){
            count++;
        }
    }
    cout << count; 
}

// Find Error