Skip to content

Commit 6c175e2

Browse files
committed
Juramento
1 parent c9d767c commit 6c175e2

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

Free/A_juramento.cpp

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#include <bits/stdc++.h>
2+
#define all(x) x.begin(),x.end()
3+
#define msg(str,str2) cout << str << str2<< endl
4+
using namespace std;
5+
6+
using ll = long long;
7+
using ld = long double;
8+
using uint = unsigned int;
9+
using ull = unsigned long long;
10+
template<typename T>
11+
using pair2 = pair<T, T>;
12+
using pii = pair<int, int>;
13+
using pli = pair<ll, int>;
14+
using pll = pair<ll, ll>;
15+
16+
#define pb push_back
17+
#define mp make_pair
18+
19+
int gcd(int a,int b){
20+
if(a%b==0) return b;
21+
else return gcd(b,a%b);
22+
}
23+
24+
clock_t startTime;
25+
double getCurrentTime() {
26+
return (double)(clock() - startTime) / CLOCKS_PER_SEC;
27+
}
28+
const int N = 1e5 +5;
29+
int ar[N];
30+
void solve(){
31+
int n; cin>>n;
32+
int maximo = INT_MIN;
33+
int minimo = INT_MAX;
34+
for(int e = 0 ; e <n;e++){
35+
cin>>ar[e];
36+
minimo = min(minimo, ar[e]);
37+
maximo = max(maximo, ar[e]);
38+
}
39+
if(n<=2){cout << 0 << endl; return;}
40+
int cont = 0 ;
41+
for(int e = 0; e < n; e++){
42+
if(ar[e] > minimo && ar[e] < maximo) cont++;
43+
}
44+
cout << cont << endl;
45+
}
46+
int main(){
47+
ios_base::sync_with_stdio(false);
48+
cin.tie(0);
49+
solve();
50+
return 0;
51+
}

0 commit comments

Comments
 (0)