G - Repair
&:分类讨论一下就够了。
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
ll n,m,a1,b1,a2,b2;
while(scanf("%lld %lld", &n, &m) != EOF)
{
scanf("%lld %lld %lld %lld", &a1, &b1, &a2, &b2);
ll x1 = max(a1,a2);
ll y1 = b1 + b2;
ll x2 = max(b1,b2);
ll y2 = a2 + a1;
ll x3 = max(a1,b2);
ll y3 = a2 + b1;
ll x4 = max(a2,b1);
ll y4 = a1+ b2;
if((n >= x1 && y1 <= m)|| (m >= x1 && y1 <= n) || (n >= x2 && y2 <= m) || (n >= y2 && x2 <= m) || (n >= x3 && y3 <= m)|| (m >= x3 && y3 <= n) || (n >= x4 && y4 <= m) || (n >= y4 && x4 <= m))printf("YES\n");
else printf("NO\n");
}
return 0;
}
标签:Repair,100971G,Gym,b2,a1,b1,&&,ll,lld From: https://blog.51cto.com/u_15965659/6056701