[恢]hdu 1205

2011-12-16 11:37:45

地址:http://acm.hdu.edu.cn/showproblem.php?pid=1205

题意:中文,不解释。

mark:注意用long long。

代码:

# include <stdio.h>


int main ()
{
int T, n, i ;
long long num, sum, max ;
scanf ("%d", &T) ;
while (T--)
{
scanf ("%d", &n) ;
max = -1 ;
sum = 0 ;
for (i = 0 ; i < n ; i++)
{
scanf ("%I64d", &num) ;
sum += num ;
if (num > max) max = num ;
}
if ((sum+1)/2 >= max) puts ("Yes") ;
else puts ("No") ;
}
return 0 ;
}



原文地址:https://www.cnblogs.com/lzsz1212/p/2314997.html