条件:
a[j] + a[j+1] < x*2
int findClosestPoint(int x,int a [])
{
int res = 0;
int j = 0;
while(j<a.length-1 && a[j]+a[j+1]<x*2) j++;
res = Math.max(res,Math.abs(x-a[j]));
return res;
}
条件:
a[j] + a[j+1] < x*2
int findClosestPoint(int x,int a [])
{
int res = 0;
int j = 0;
while(j<a.length-1 && a[j]+a[j+1]<x*2) j++;
res = Math.max(res,Math.abs(x-a[j]));
return res;
}