2 3 4 1 1 5 5 4 3 2 1
No Yes
代码
#include <stdio.h>
int main()
{
long i,n;
double max,number,sum;
scanf("%d",&n);
while(n--)
{
scanf("%d",&i);
max=0;
sum=0;
while(i--)
{
scanf("%lf",&number);
if(number>max)
max=number;
sum+=number;
}
sum-=max;
if(max<=sum+1)
printf("Yes\n");
else
printf("No\n");
}
return 0;
}
原文:http://blog.csdn.net/blue_skyrim/article/details/46126049