现在的位置: 首页 > 综合 > 正文

hdoj1205简单题、模拟题

2013年10月12日 ⁄ 综合 ⁄ 共 270字 ⁄ 字号 评论关闭
# include <iostream>//找规律
# include <iomanip>
using namespace std;

int main(){
	int m;
	int n;
	double a, max, total;
	cin>>m;
	for(int i = 0; i < m; i++){
		cin>>n;
		cin>>a;
		max = a;
		total = a;
		for(int j = 1; j < n; j++){
			cin>>a;
			if(a > max){
				max = a;
			}
			total += a;
		}
		if(total - max + 1 >= max){
			cout<<"Yes"<<endl;
		}else{
			cout<<"No"<<endl;
		}
	}
}

抱歉!评论已关闭.