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的网格,让你 ...
随机推荐
- T-SQL查询进阶-10分钟理解游标
转:http://www.cnblogs.com/CareySon/archive/2011/11/01/2231381.html 概述 游标是邪恶的! 在关系数据库中,我们对于查询的思考是面向集合的 ...
- 总结c++ primer中的notes
转载:http://blog.csdn.net/ace_fei/article/details/7386517 说明: C++ Primer, Fourth Edition (中英文)下载地址:htt ...
- RTNETLINK answers: File exists错误
解决ssh连接虚拟机出错,RTNETLINK answers: File exists 解决步骤如下: 使用ssh连接虚拟机的时候,发现目标主机无法连接,登录虚拟机,查看ssh监听是否开启: 发现监听 ...
- Python相关书籍推荐
Python基础教程(第2版 修订版) 作 者 [挪] Magnus Lie Hetland 著:司维,曾军崴,谭颖华 译 出 版 社 人民邮电出版社 出版时间 2014-06-01 版 ...
- (转载)OC学习篇之---概述
前言 终于开启了OC的学习篇了,之前由于工作上的事,学习就一直搁浅了,不过最近由于各种原因,感觉必须要开启iOS的开发旅程了,不然就老了.因为之前一直是做Android的,所以学习iOS来就没那么费劲 ...
- leetcode—Swap Nodes in Pairs
1.题目描述 Given a linked list, swap every two adjacent nodes and return its head. For example, Given ...
- mysqldump造成Buffer Pool污染的研究
前言: 最近Oracle MySQL在其官方Blog上贴出了 5.6中一些变量默认值的修改.其中innodb_old_blocks_time 的默认值从0替换成了1000(即1s) 关于该参数的作用摘 ...
- homework-09
这次作业主要考察C++11的简单用法,个人感觉这样的练习对我这种编程能力比较差的非常有用,加深了对C++11的理解. Lambda的用法 计算“Hello World!”中 a.字母‘e’的个数 b. ...
- ubuntu 备份安装程序列表
一般情况下,我们重装ubuntu的系统会做如下几个事情 1)修改默认的程序更新源 2)开始根据需求安装软件. 3)配置文件(如vim/tmux等) 对于步骤,只需要cp /etc//etc/apt/s ...
- Gym 100507I Traffic Jam in Flower Town (模拟)
Traffic Jam in Flower Town 题目链接: http://acm.hust.edu.cn/vjudge/contest/126546#problem/I Description ...