Untitled
unknown
c_cpp
a year ago
821 B
11
Indexable
#include <bits/stdc++.h> using namespace std; #define ll long long #define ye cout<<"YES"<<endl; #define no cout<<"NO"<<endl; int M = INT_MIN; int S = INT_MAX; vector<int> v; int arr[4] = {}; void fast() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); } int fr[125]; int main() { fast(); int b; cin >> b; vector<int>v(b); for (auto& t : v) cin >> t; sort(v.begin(), v.end()); int front, back,c=b-2; front = v[0]; back = v[b - 1]; if (front != back) { for (int i = 1; i < b - 1; i++) if (front == v[i] or back == v[i]) c--; cout << c; } else cout<<0; return 0; }
Editor is loading...
Leave a Comment