β Absolute value discrepancy (Contest)
Absolute value discrepancy easy Time Limit: 2 sec Memory Limit: 128000 kB
#include <bits/stdc++.h> // header file includes every Standard library
using namespace std;
#define int long long
signed main(){
int n;
cin >>
vector<int>a(n);
for(auto &i : a) cin>>i;
sort(a.begin(),a.end());
cout<<a[n-1] - a[0];
}
Last updated