Codeforces1216C 几何

考虑x3 y3 x4 y4全覆盖
考虑x5 y5 x6 y6全覆盖
考虑平行左右放置 定两个y 变x
考虑平行上下放置 定两个x 变y

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=2e5+5;

ll x1,y;
ll x2,y2,x3,y3,x4,y4,x5,y5,x6,y6;
int main(){
	cin>>x1>>y>>x2>>y2;
	cin>>x3>>y3>>x4>>y4;
	cin>>x5>>y5>>x6>>y6;
	if(x3<=x1 && y3<=y && x2<=x4 && y2<=y4){
		cout<<"NO"<<endl;
		return 0;
	}
	if(x5<=x1 && y5<=y && x2<=x6 && y2<=y6){
		return cout<<"NO"<<endl,0;
	}
	if(y3<=y && y4>=y2 && y5<=y && y6>=y2){
		ll l1=min(x3,x5),r1=max(x4,x6);
		ll l2=max(x3,x5),r2=min(x4,x6);
		if(l1<=x1 && r1>=x2 && l2<=r2)
			return cout<<"NO"<<endl,0;
	}
	if(x3<=x1 && x4>=x2 && x5<=x1 && x6>=x2){
		ll l1=min(y3,y5),h1=max(y4,y6);
		ll l2=max(y3,y5),h2=min(y4,y6);
		if(l1<=y && h1>=y2 && l2<=h2)
			return cout<<"NO"<<endl,0;
	}
	cout<<"YES"<<endl;
	return 0;
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值