杭电ACM吃糖果问题
最后更新于:2022-04-01 09:47:47
~~~
#include <iostream>
#include <stdio.h>
using namespace std;
int main()
{
int n,m,i,k=0;
int sum=0;
cin>>n;
while (n--)
{
cin>>m;
while (m--)
{
cin>>i;
k=i>k?i:k;
sum=sum+i;
}
sum=sum-k;
if(sum+1>=k)
cout<<"Yes"<<endl;
else
cout<<"No"<<endl;
k=0;
sum=0;
}
return 0;
}
~~~