White Sheet
思路:先看代码,分成了四个条件。第一个和第二个表示的都是当白矩形存在某个黑矩形内部的情况。
另外就是:白矩形位于两个黑矩形的并集区域。
即可分为两种情况,一种是白矩形位于竖的区域(条件三),上图:
那么黄色区域就是判断范围
另一种是横的区域(条件四):
黄色区域即判断范围。
代码:
x1,y1,x2,y2=map(int,input().split())
x3,y3,x4,y4=map(int,input().split())
x5,y5,x6,y6=map(int,input().split())
flag=False
if x3<=x1 and y3 <=y1 and x4>=x2 and y4>=y2:
flag=True
elif x5<=x1 and y5 <=y1 and x6>=x2 and y6>=y2:
flag=True
elif x1>=max(x3,x5) and x2<=min(x4,x6):
if min(y4,y6)>=max(y3,y5) and min(y3,y5)<=y1 and max(y4,y6)>=y2:
flag=True
elif y1>=max(y3,y5) and y2 <=min(y4,y6):
if min(x4,x6)>=max(x3,x5) and min(x3,x5)<=x1 and max(x4,x6)>=x2:
flag=True
print("NO" if flag else "YES")
White Sheet的更多相关文章
- Codeforces Round #587 (Div. 3) C. White Sheet
链接: https://codeforces.com/contest/1216/problem/C 题意: There is a white sheet of paper lying on a rec ...
- 题解 CF1216C 【White Sheet】
虽然也很水,但这道还是比前两道难多了... 题目大意:给你三个位于同一平面直角坐标系的矩形,询问你后两个是否完全覆盖了前一个 首先,最直观的想法应该是,把第一个矩形内部每个整数点检查一下,看看是否位于 ...
- Codeforces Round #587 C. White Sheet(思维+计算几何)
传送门 •题意 先给一个白矩阵,再两个黑矩阵 如果两个黑矩阵能把白矩阵包含,则输出NO 否则输出YES •思路 计算几何题还是思维题呢? 想起了上初中高中做几何求面积的题 这个就类似于那样 包含的话分 ...
- [CF1216C] White Sheet - 离散化,模拟
虽然分类讨论应该是比较推崇的解法,但是我就是喜欢暴力 #include <bits/stdc++.h> using namespace std; #define int long long ...
- C#中如何给Excel添加水印
我们知道Microsoft Excel并没有内置的功能直接给Excel表添加水印,但是其实我们可以用其他变通的方式来解决此问题,如通过添加页眉图片或艺术字的方法来模仿水印的外观.所以在这篇文章中,我将 ...
- ural 1147. Shaping Regions
1147. Shaping Regions Time limit: 0.5 secondMemory limit: 64 MB N opaque rectangles (1 ≤ N ≤ 1000) o ...
- C# asp Aspose.Cells 教程,包含增加勾选框,单元格,字体设置
1,引用Aspose.Cells dll 2,using Aspose.Cells; 3, Workbook excel = new Workbook(); string strFilePath = ...
- ural1147 Shaping Regions
Shaping Regions Time limit: 0.5 secondMemory limit: 64 MB N opaque rectangles (1 ≤ N ≤ 1000) of vari ...
- C# 操作Excel加水印
首先下载免费版的Excel组件- Spire.XLS,安装完成后在bin目录里面有需要用到的dll文件,引用到自己项目里面. 我这里全引进来了,一共就四个: 界面 效果 全部代码 private st ...
随机推荐
- 使用 ASP.NET Core 的 gRPC 服务
将 gRPC 服务添加到 ASP.NET Core 应用 gRPC 需要gRPC包. 配置 gRPC 在 Startup.cs 中: gRPC 是通过AddGrpc方法启用的. 每个 gRPC 服务通 ...
- ui组件库
基于Vue的Quasar Framework 中文网 http://www.quasarchs.com/ quasarframework/quasar: Quasar Frameworkhttps:/ ...
- 配置rsync同步文件到nas
windows下以前的做法是安装一个cygwin包,现在不需要了,直接安装一个linux子系统用linux命令就行了. start cmd /k "c:\cygwin64\bin\rsync ...
- mybatis报错,There is no getter for property named 'templateName' in 'class
There is no getter for property named 'templateName' in 'class 主要原因是因为mapper.xml 的语句有错误,导致在bean里找不到相 ...
- 详解python中的生成器表达式
什么是生成器表达式 还记得列表解析吗?我们把[]换成()就变成生成器表达式了. g = (x for x in [1, 2, 3, 4]) print(g) # <generator objec ...
- Java 通过Math.random() 生成6位随机数
public static void main(String[] args) { String sjs=""; for (int i = 0; i < 6; i++) { i ...
- eclipse集成springboot 插件(离线安装,含解决Cannot complete the install because one or more required items could)
版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog.csdn.net/li18310727696/article/details/81071002首先,确认eclipse的 ...
- window dos 下批量删除docker 容器
>dokcer ps -a -q> 1.txt (写入所有已暂停容器id) >for /f %a in (1.txt) do docker rm %a for 循环 /f ...
- 卸载TensorFlow
卸载TensorFlow 1.先用pip3 list查看安装了那些TensorFlow,一般只有两个,另一个是TensorBoard 2.执行命令卸载 sudo apt remove --purge ...
- centos7安装BitCoin客户端
一.安装依赖环境 [root@localhost src]# yum install autoconf automake libtool libdb-devel boost-devel libeven ...

