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/problem/B
Description
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 an a1 × b1 rectangle, the paintings have shape of a a2 × b2 and a3 × 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 and b1 — the sides of the board. Next two lines contain numbers a2, b2, a3 andb3 — the sides of the paintings. All numbers ai, bi in the input are integers and fit into the range from 1 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 Input
3 2
1 3
2 1
Sample Output
YES
HINT
题意
给你n*m的矩形,问你能否同事摆下n1*m1和n2*m2的矩形
题解:
就判断判断……
就搞啊搞
看代码吧
代码
#include <cstdio>
#include <cmath>
#include <cstring>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <set>
#include <vector>
#include <sstream>
#include <queue>
#include <typeinfo>
#include <fstream>
#include <map>
#include <stack>
typedef long long ll;
using namespace std;
//freopen("D.in","r",stdin);
//freopen("D.out","w",stdout);
#define sspeed ios_base::sync_with_stdio(0);cin.tie(0)
#define test freopen("test.txt","r",stdin)
const int maxn=;
#define mod 1000000007
#define eps 1e-9
const int inf=0x3f3f3f3f;
const ll infll = 0x3f3f3f3f3f3f3f3fLL;
inline ll read()
{
ll x=,f=;char ch=getchar();
while(ch<''||ch>''){if(ch=='-')f=-;ch=getchar();}
while(ch>=''&&ch<=''){x=x*+ch-'';ch=getchar();}
return x*f;
}
//**************************************************************************************
int a1,b1,a2,b2,a3,b3; int main(){
cin>>a1>>b1>>a2>>b2>>a3>>b3;
if (max(a2,a3)<=a1&&b2+b3<=b1||
max(a2,a3)<=b1&&b2+b3<=a1||
max(a2,b3)<=a1&&b2+a3<=b1||
max(a2,b3)<=b1&&b2+a3<=a1||
max(b2,a3)<=a1&&a2+b3<=b1||
max(b2,a3)<=b1&&a2+b3<=a1||
max(b2,b3)<=a1&&a2+a3<=b1||
max(b2,b3)<=b1&&a2+a3<=a1) cout << "YES\n";
else cout << "NO\n";
}
Codeforces Round #313 (Div. 2) B. Gerald is into Art 水题的更多相关文章
- 【打CF,学算法——二星级】Codeforces Round #313 (Div. 2) B. Gerald is into Art(水题)
[CF简单介绍] 提交链接:http://codeforces.com/contest/560/problem/B 题面: B. Gerald is into Art time limit per t ...
- 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 ...
- Codeforces Round #368 (Div. 2) A. Brain's Photos (水题)
Brain's Photos 题目链接: http://codeforces.com/contest/707/problem/A Description Small, but very brave, ...
- 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 ...
- 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/ ...
- 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 ...
- 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 ...
- 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 ...
- dp - Codeforces Round #313 (Div. 1) C. Gerald and Giant Chess
Gerald and Giant Chess Problem's Link: http://codeforces.com/contest/559/problem/C Mean: 一个n*m的网格,让你 ...
随机推荐
- 一个响应式框架——agera
Google在上周开源了一个响应式框架——agera,相信它会慢慢地被广大程序员所熟知.我个人对这样的技术是很感兴趣的,在这之前也研究过RxJava,所以在得知Google开源了这样的框架之后第一时间 ...
- Ejabberd源码解析前奏--概述
一.绪论 Ejabberd是一个用Erlang/OTP写的开源即时通讯服务器,其是跨平台.分布式.容错且基于开放标准的实时通讯系统.Ejabberd是一个功能丰富的XMPP服务器,同时适合小规模 ...
- C# winform 若要在加载设计器前避免可能发生的数据丢失,必须纠正以下错误
winform中有时添加了新控件之后编译会报错: 若要在加载设计器前避免可能发生的数据丢失,必须纠正以下错误,如图: 解决方案: 1.“解决方案”→“批生成”→“清理”→“确定”: 2.“解决方案”→ ...
- 细雨学习笔记:Jmeter参数化
目前我用到两种方式: 1)某个参数,值不常改变的,好多地方都用到:请用“用户定义的变量” 用户组,右键--添加--配置原件--用户定义的变量,在这添加. 如何使用呢?在需要用到此参数的地方这样引用: ...
- C#几种截取字符串的方法小结
1.根据单个分隔字符用split截取例如代码如下: string st="GT123_1"; string[] sArray=st.split("_"); 即可 ...
- C++ 出现bug :二位数组的操作运算,求非对角线的元素的和
编写一个通用程序,求出二位数组(行数和列数必须相等)的非对角线的元素之和,试建立类MATRIX完成上述功能 #include<iostream> using namespace std; ...
- ARM体系的异常中断
在ARM体系中,通常有3种方式控制处理器的流程 1:在正常执行过程中,每执行一条ARM指令,程序计数器寄存器PC的值加四个字节,在每执行一条Thumb指令,程序计数器寄存器PC的值加两个字节,整个过 ...
- 中断——中断处理程序的进入与退出 (基于3.16-rc4)
上一篇博文我们分析了中断描述符表的中断门初始化过程,并且在interrupt数组中初始化过程中,可以看到每个中断处理程序都会跳入common_interrupt中.下面我们分析下common_inte ...
- 迁移web.py项目至git@osc的项目演示平台
1. 开启演示平台 选择WSGI,输入应用名称,即是演示网页的网址. 2. web.py代码迁移 将Python的site-packages目录下的web文件夹复制到代码目录下,与网页程序在同一个文件 ...
- 【bz2002】弹飞绵羊
题意: 给出n个节点 及其父亲 和m个指令1:表示求节点i到根节点(n+1)的距离2:表示将节点i的父亲更换为j 题解: 动态树link.cut.access模板题 貌似没什么难度- - 代码: #i ...