Problem Description
1 #include<stdio.h> 2 int main() 3 { 4 int t,n; 5 long long sum; 6 int i,j; 7 int max; 8 int a; 9 scanf("%d",&t); 10 for (j=0;j<t;j++) 11 { 12 scanf("%d",&n); 13 max=0; sum=0; 14 for (i=0;i<n;i++) 15 { 16 scanf("%d",&a); 17 sum=sum+a; 18 if (a>max) max=a; 19 } 20 sum=sum-max; 21 if (max<=sum+1) 22 printf("Yes\n"); 23 else 24 printf("No\n"); 25 } 26 return 0; 27 }
原文:http://www.cnblogs.com/leiyuxiang/p/3515953.html