【CF简单介绍】

提交链接:http://codeforces.com/contest/560/problem/B

题面:

B. Gerald is into Art
time limit per test

2 seconds

memory limit per test

256 megabytes

input

standard input

output

standard output

Gerald bought two very rare paintings at the Sotheby's auction and he now wants to hang them on the wall. For that he bought a special board to attach it to the wall and place the paintings on the board. The board has shape of ana1 × b1
rectangle, the paintings have shape of aa2 × b2 anda3 × b3
rectangles.

Since the paintings are painted in the style of abstract art, it does not matter exactly how they will be rotated, but still, one side of both the board, and each of the paintings must be parallel to the floor. The paintings can touch each other and the
edges of the board, but can not overlap or go beyond the edge of the board. Gerald asks whether it is possible to place the paintings on the board, or is the board he bought not large enough?

Input

The first line contains two space-separated numbers a1 andb1 — the sides of the board. Next two lines contain numbersa2, b2, a3
andb3 — the sides of the paintings. All numbersai, bi in the
input are integers and fit into the range from1 to
1000.

Output

If the paintings can be placed on the wall, print "YES" (without the quotes), and if they cannot, print "NO" (without the quotes).

Sample test(s)
Input
3 2
1 3
2 1
Output
YES
Input
5 5
3 3
3 3
Output
NO
Input
4 2
2 3
1 2
Output
YES
Note

That's how we can place the pictures in the first test:

And that's how we can do it in the third one.

解题:

就是看能不能把两块画。放进板内,要求画必须平行于板。

代码:

#include <iostream>
#include <algorithm>
#include <cstdio>
using namespace std;
int main()
{
int l1,w1,l2,w2,l3,w3;
scanf("%d%d",&l1,&w1);
scanf("%d%d",&l2,&w2);
scanf("%d%d",&l3,&w3);
bool flag=false;
if((l2+l3)<=l1&&(w2<=w1&&w3<=w1))
flag=true;
else if((l2+w3)<=l1&&(w2<=w1)&&(l3<=w1))
flag=true;
else if((w2+l3)<=l1&&(l2<=w1)&&(w3<=w1))
flag=true;
else if((w2+w3)<=l1&&(l2<=w1&&l3<=w1))
flag=true;
else if((w2+w3)<=w1&&(l2<=l1)&&(l3<=l1))
flag=true;
else if((w2+l3)<=w1&&(l2<=l1)&&(w3<=l1))
flag=true;
else if((l2+w3)<=w1&&(w2<=l1)&&(l3<=l1))
flag=true;
else if((l2+l3)<=w1&&(w2<=l1)&&(w3<=l1))
flag=true;
if(flag)printf("YES\n");
else printf("NO\n");
return 0;
}

【打CF,学算法——二星级】Codeforces Round #313 (Div. 2) B. Gerald is into Art(水题)的更多相关文章

  1. Codeforces Round #313 (Div. 2) B. Gerald is into Art 水题

    B. Gerald is into Art Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/560 ...

  2. Codeforces Round #313 (Div. 2) A. Currency System in Geraldion 水题

    A. Currency System in Geraldion Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/c ...

  3. Codeforces Round #368 (Div. 2) A. Brain's Photos (水题)

    Brain's Photos 题目链接: http://codeforces.com/contest/707/problem/A Description Small, but very brave, ...

  4. Codeforces Round #373 (Div. 2) C. Efim and Strange Grade 水题

    C. Efim and Strange Grade 题目连接: http://codeforces.com/contest/719/problem/C Description Efim just re ...

  5. Codeforces Round #185 (Div. 2) A. Whose sentence is it? 水题

    A. Whose sentence is it? Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/ ...

  6. Codeforces Round #373 (Div. 2) A. Vitya in the Countryside 水题

    A. Vitya in the Countryside 题目连接: http://codeforces.com/contest/719/problem/A Description Every summ ...

  7. Codeforces Round #371 (Div. 2) A. Meeting of Old Friends 水题

    A. Meeting of Old Friends 题目连接: http://codeforces.com/contest/714/problem/A Description Today an out ...

  8. Codeforces Round #355 (Div. 2) B. Vanya and Food Processor 水题

    B. Vanya and Food Processor 题目连接: http://www.codeforces.com/contest/677/problem/B Description Vanya ...

  9. 【打CF,学算法——三星级】Codeforces Round #313 (Div. 2) C. Gerald&#39;s Hexagon

    [CF简单介绍] 提交链接:http://codeforces.com/contest/560/problem/C 题面: C. Gerald's Hexagon time limit per tes ...

随机推荐

  1. Eclipse 中导入jar包

    导入到工程即可使用了1. 在程序目录下,创建一个文件夹,如 lib. 2. 将第三方jar包复制到该目录下3.右键工程,选择Build path4.java build path,选择 librari ...

  2. linux查看进程和线程的命令

    1.任务:获得进程信息 :ps命令,或者top命令,它能显示当前运行中进程的相关信息,包括进程的PID. ps命令能提供一份当前进程的快照.如果想状态可以自动刷新,可以使用top命令. 2.任务:获得 ...

  3. pm2 相关命令

    pm2 相关命令 转载 2017年02月18日 22:59:48   二.安装 Linux Binaries下载地址:https://nodejs.org/dist cd oneinstack/src ...

  4. Netty框架

    Netty框架新版本号:3.0.2.GA,于2008年11月19日公布.Netty项目致力于提供一个异步的.事件驱动的网络应用框架和工具,用于高速开发可维护的.高性能的.高扩展性的server和cli ...

  5. ArcGIS For Android ExportTileCache应用

    说明:从ArcGIS For Android10.2.4 ,開始支持下载在线地图服务切片缓存到移动设备本地.以便离线时进行地图浏览.本文章摘要介绍,使用自己公布的服务时,须要注意的内容. 一.首先公布 ...

  6. Table里td中的文本过长,设置不换行,随内容同行显示(转载)

    当td中内容过长时,内容会溢出,换行显示,美观超级差,在td里设置这个属性 "white-space:nowrap   就可以解决排版问题啦 <td style="white ...

  7. 如何获得Windows Server 2012上的FC的WWN

    我有一个测试环境, 一对Host与storage array之间既有iSCSI的连接, 也有FC的连接. 原来iSCSI的连接是OK的, 现在需要转用FC. 当在光纤交换机上划好了Zone之后, st ...

  8. 用mysqlslap对MySQL进行压力测试

    MySQL5.1地的确提供了好多有力的工具来帮助我们DBA进行数据库管理.现在看一下这个压力测试工具mysqlslap.关于他的选项手册上以及--help介绍的很详细.我解释一下一些常用的选项.这里要 ...

  9. Android -- Sqlite事务

    这也是通过Android Juint来实现的. 基于上一次的工程继续,上一次工程传送门:<Android–Android Juint 与 Sqlite> http://www.cnblog ...

  10. windows获取本机MAC地址并写入文件的bat

    windows获取本机MAC地址并写入文件的bat MAC(Media Access Control)地址,或称为 MAC地址.硬件地址,用来定义网络设备的位置. bat代码例如以下: @echo o ...