Codeforces Gym 100531G Grave 水题

时间:2022-10-15 09:33:01

Problem G. Grave

题目连接:

http://codeforces.com/gym/100531/attachments

Description

Gerard develops a Halloween computer game. The game is played on a rectangular graveyard with a

rectangular chapel in it. During the game, the player places new rectangular graves on the graveyard.

The grave should completely fit inside graveyard territory and should not overlap with the chapel. The

grave may touch borders of the graveyard or the chapel.

Gerard asked you to write a program that determines whether it is possible to place a new grave of given

size or there is no enough space for it.

Input

The first line of the input file contains two pairs of integers: x1, y1, x2, y2 (−109 ≤ x1 < x2 ≤ 109

;

−109 ≤ y1 < y2 ≤ 109

) — coordinates of bottom left and top right corners of the graveyard. The second

line also contains two pairs of integers x3, y3, x4, y4 (x1 < x3 < x4 < x2; y1 < y3 < y4 < y2) —

coordinates of bottom left and top right corners of the chapel.

The third line contains two integers w, h — width and height of the new grave (1 ≤ w, h ≤ 109

). Side

with length w should be placed along OX axis, side with length h — along OY axis

Output

The only line of the output file should contain single word: “Yes”, if it is possible to place the new grave,

or “No”, if there is not enough space for it.

Sample Input

1 1 11 8

2 3 8 6

3 2

Sample Output

Yes

Hint

题意

有一个矩形,然后在里面放一个矩阵,问你还能不能再放进去一个w*h的矩阵进去

题解:

水题,只有四个空位子,把这四个位置都判断一下就好

代码

#include<bits/stdc++.h>
using namespace std; int x1,y1,x2,y2;
int x3,y3,x4,y4;
int w,h;
int main()
{
freopen("grave.in","r",stdin);
freopen("grave.out","w",stdout);
cin>>x1>>y1>>x2>>y2;
cin>>x3>>y3>>x4>>y4;
cin>>w>>h;
int l = x2 - x1;
int H = y2 - y1;
if(l>=w&&y3-y1>=h)
return puts("Yes");
if(l>=w&&y2-y4>=h)
return puts("Yes");
if(H>=h&&x3-x1>=w)
return puts("Yes");
if(H>=h&&x2-x4>=w)
return puts("Yes");
return puts("No");
}

Codeforces Gym 100531G Grave 水题的更多相关文章

  1. Gym 100531G Grave&lpar;水题&rpar;

    题意:给定一个大矩形,再给定在一个小矩形,然后给定一个新矩形的长和高,问你能不能把这个新矩形放到大矩形里,并且不与小矩形相交. 析:直接判定小矩形的上下左右四个方向,能不能即可. 代码如下: #pra ...

  2. Codeforces Gym 100286I iSharp 水题

    Problem I. iSharpTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/ ...

  3. CodeForces Gym 100685C Cinderella &lpar;水题&rpar;

    题意:给定 n 个杯子,里面有不同体积的水,然后问你要把所有的杯子的水的体积都一样,至少要倒少多少个杯子. 析:既然最后都一样,那么先求平均数然后再数一下,哪个杯子的开始的体积就大于平均数,这是一定要 ...

  4. codeforces 706A A&period; Beru-taxi&lpar;水题&rpar;

    题目链接: A. Beru-taxi 题意: 问那个taxi到他的时间最短,水题; AC代码: #include <iostream> #include <cstdio> #i ...

  5. codeforces 569B B&period; Inventory&lpar;水题&rpar;

    题目链接: B. Inventory time limit per test 1 second memory limit per test 256 megabytes input standard i ...

  6. Codeforces 489A SwapSort (水题)

    A. SwapSort time limit per test 1 second memory limit per test 256 megabytes input standard input ou ...

  7. UVaLive 6591 &amp&semi;&amp&semi; Gym 100299L Bus &lpar;水题&rpar;

    题意:略. 析:不解释,水题. 代码如下: #pragma comment(linker, "/STACK:1024000000,1024000000") #include &lt ...

  8. codeforces 688A A&period; Opponents&lpar;水题&rpar;

    题目链接: A. Opponents time limit per test 1 second memory limit per test 256 megabytes input standard i ...

  9. CodeForces 534B Covered Path &lpar;水题&rpar;

    题意:给定两个速度,一个一初速度,一个末速度,然后给定 t 秒时间,还每秒速度最多变化多少,让你求最长距离. 析:其实这个题很水的,看一遍就知道怎么做了,很明显就是先从末速度开始算起,然后倒着推. 代 ...

随机推荐

  1. Android -- 背景虚化

    1,在项目中我们常有这样的需求,就是在个人中心的时候,当用户登录后,要显示用户登陆后的头像,然后背景是用户头像的虚化 ,接下来就来实现一下这个功能,先看一下效果 2,实现起来也挺简单的,没什么难度 , ...

  2. algorithm之不变序列操作

    概述:不变序列算法,参见http://www.cplusplus.com/reference/algorithm/ /* std::for_each template <class InputI ...

  3. express框架目录结构

    . ├── app.js ├── bin │   └── www ├── node_modules │   ├── body-parser │   ├── cookie-parser │   ├── ...

  4. WiresShark 使用方法

    Wireshark(前称Ethereal)是一款功能强大的网络抓包分析工具,在我的工作中是不可或缺的一部分工具,往往在网络出现异常时,查看网络中的数据包,会豁然开朗.1.菜单栏  主菜单包括以下几个项 ...

  5. 2016大连网络赛 Weak Pair

    Weak Pair Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others) Prob ...

  6. 开涛spring3&lpar;12&period;3&rpar; - 零配置 之 12&period;3 注解实现Bean定义

    12.3  注解实现Bean定义 12.3.1  概述 前边介绍的Bean定义全是基于XML方式定义配置元数据,且在[12.2注解实现Bean依赖注入]一节中介绍了通过注解来减少配置数量,但并没有完全 ...

  7. &lbrack;Spark内核&rsqb; 第37课:Task执行内幕与结果处理解密

    本课主题 Task执行内幕与结果处理解密 引言 这一章我们主要关心的是 Task 是怎样被计算的以及结果是怎么被处理的 了解 Task 是怎样被计算的以及结果是怎么被处理的 Task 执行原理流程图 ...

  8. 动态加载与插件系统的初步实现(三):WinForm示例

    代码文件在此Download,本文章围绕前文所述默认AppDomain.插件容器AppDomain两个域及IPlugin.PluginProvider.PluginProxy3个类的使用与变化进行. ...

  9. java多线程&lpar;四&rpar;之同步机制

    1.同步的前提 多个线程 多个线程使用的是同一个锁 2.同步的好处 同步的出现解决了多线程的安全问题 3.同步的弊端 当线程较多时, 因为每个线程都会去判断同步上的锁, 这样是很耗费资源的, 会降低程 ...

  10. Windows -&gt&semi;&gt&semi; Windows Server 2012打开管理添加&OpenCurlyDoubleQuote;我的电脑”桌面图标途径

    Windows Server 2012打开管理添加“我的电脑”桌面图标途径 rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,0