You are viewing a single comment's thread. Return to all comments →
Here is my solution for this (C++)
const ll MOD = (ll) 1e18+3; using namespace std; ll n,a[100001],ans=1e9+1; void fastip(){ ios_base::sync_with_stdio(0); cin.tie(0);cout.tie(0); }
int main(){ fastip(); cin>> n; for (int i=0;i>a[i]; } sort(a,a+n); for (int i=1;i
Seems like cookies are disabled on this browser, please enable them to open this website
Minimum Absolute Difference in an Array
You are viewing a single comment's thread. Return to all comments →
Here is my solution for this (C++)
include
define ll long long
define minimize(a,b) a=min(a,b)
const ll MOD = (ll) 1e18+3; using namespace std; ll n,a[100001],ans=1e9+1; void fastip(){ ios_base::sync_with_stdio(0); cin.tie(0);cout.tie(0); }
int main(){ fastip(); cin>> n; for (int i=0;i>a[i]; } sort(a,a+n); for (int i=1;i