1370bulid by paekae at 2017-12-24 13:42
Rating:-

#include<iostream>

#include<cstdio>

#include<cstring>

#include<algorithm>

#define rnt rsgister int

#define min(x,y) (x)>(y)?(y):(x)

#define max(x,y) (x)<(y)?(y):(x)

using namespace std;

int n,m;

int mp[100001];

int main()

{

int ans=0,t;

cin>>n ;

long long max1,min1;

for(int i=1;i<=n;i++)cin>>mp[i];

sort(mp+1,mp+n+1);

for(int i=1;i<=n;i++)

{

max1=0,min1=0x3f3f3f3f;

if(i!=n)

min1=min(min1,mp[i+1]-mp[i]);

max1=max(max1,mp[n]-mp[i]);

max1=max(max1,mp[i]-mp[1]);

if(i!=1)

min1=min(min1,mp[i]-mp[i-1]);

cout<<min1<<' '<<max1<<endl;

}

}



回复
要回复,请先登录

T^T Online Judge

[BUG反馈] [FAQ] [闽ICP备17026590号-1]
当前版本:3.24 系统时间: