Codeforces 1279A New Year Garland(鸽巢原理)

题目链接:

Codeforces 1279A New Year Garland

思路:

简单的鸽巢原理思想

代码:

#include<bits/stdc++.h>
using namespace std;
typedef pair<int,int> P;
typedef long long LL;
#define fi first
#define sc second
#define pb(a) push_back(a)
#define mp(a,b) make_pair(a,b)
#define pt(a) cerr<<a<<"---\n"
#define rp(i,n) for(int i=0;i<n;i++)
#define rpn(i,n) for(int i=1;i<=n;i++)
int main(){
	ios::sync_with_stdio(false); cin.tie(nullptr);
	int t; cin>>t;
	while(t--){
		int a[3]; rp(i,3) cin>>a[i];
		sort(a,a+3);
		int x=a[2],y=a[0]+a[1];
		if(y<x-1) cout<<"No\n";
		else cout<<"Yes\n";
	}
	return 0;
}
posted @ 2019-12-28 17:53  YuhanのBlog  阅读(145)  评论(0编辑  收藏  举报