Codeforces Round #313 (Div. 2)B.B. Gerald is into Art
B. Gerald is into Art
Time Limit: 20 Sec
Memory Limit: 256 MB
题目连接
http://codeforces.com/problemset/problem/560/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?
intput
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
4 2
2 3
1 2
Sample Output
YES
HINT
题意
是否能将下面两个矩形放入第一个矩形
题解:
无脑
代码
#include <iostream>
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <string>
#include <stack>
#include <math.h>
#include <vector>
#include <string.h>
using namespace std; typedef __int64 ll;
const int INF = (int)1E9+;
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 main()
{
int a1,a2,a3,b1,b2,b3;
int a,b;
scanf("%d%d",&a,&b);
scanf("%d%d",&a2,&b2);
scanf("%d%d",&a3,&b3); if((max(a2,b3)<=a&&(b2+a3)<=b)||
(max(a2,b3)<=b&&(b2+a3)<=a)||
(max(b2,b3)<=b&&(a3+a2)<=a)||
(max(b2,b3)<=a&&(a3+a2)<=b)||
(max(a2,a3)<=a&&(b2+b3)<=b)||
(max(a2,a3)<=b&&(b2+b3)<=a)||
(max(b2,a3)<=a&&(b3+a2)<=b)||
(max(b2,a3)<=b&&(b3+a2)<=a))
{
printf("YES\n");
}
else printf("NO\n");
return ;
}
Codeforces Round #313 (Div. 2)B.B. Gerald is into Art的更多相关文章
- Codeforces Round #313 (Div. 2) C. Gerald's Hexagon 数学
C. Gerald's Hexagon Time Limit: 2 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/559/pr ...
- Codeforces Round #313 (Div. 1) A. Gerald's Hexagon 数学题
A. Gerald's Hexagon Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/559/p ...
- 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 ...
- Codeforces Round #313 (Div. 1) C. Gerald and Giant Chess DP
C. Gerald and Giant Chess Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest ...
- 【打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 B C 思路 枚举 数学
A. Currency System in Geraldion time limit per test 2 seconds memory limit per test 256 megabytes in ...
- Codeforces Round #313 (Div. 2)(A,B,C,D)
A题: 题目地址:Currency System in Geraldion 题意:给出n中货币的面值(每种货币有无数张),要求不能表示出的货币的最小值.若全部面值的都能表示,输出-1. 思路:水题,就 ...
- Codeforces Round #313 (Div. 2) 解题报告
A. Currency System in Geraldion: 题意:有n中不同面额的纸币,问用这些纸币所不能加和到的值的最小值. 思路:显然假设这些纸币的最小钱为1的话,它就能够组成随意面额. 假 ...
- 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的网格,让你 ...
随机推荐
- 工具类HttpServerUtility
在ASP.NET服务器上提供一个辅助的工具类HttpServerUtility,该类提供了一些处理请求的辅助方法. MapPath:计算网站中虚拟路径所对应的物理文件路径. HtmlEncode:将H ...
- phpcms下载下来的程序刚安装就报错了
你服务器设置的索引等级 index.php比index.html的等级高.你输入地址 http://你的域名/index.html试试. ( ! ) Warning: array_keys() exp ...
- windows下的文件到linux下乱码 iconv 修改文件编码
conv [选项...] [文件...] 有如下选项可用: 输入/输出格式规范:-f, --from-code=名称 原始文本编码-t, --to-code=名称 输出编码 信息:-l, --list ...
- Apache Common DbUtils
前段时间使用了Apache Common DbUtils这个工具,在此留个印,以备不时查看.大家都知道现在市面上的数据库访问层的框架很多,当然很多都是包含了OR-Mapping工作步骤的 例如大家常用 ...
- linux 搭建hexo博客
搭建环境: CentOS 6.5 1.安装git的编译包 yum -y install gcc zlib-devel openssl-devel perl cpio expat-devel gette ...
- 【云计算】Docker集中化web界面管理平台shipyard
Docker集中化web界面管理平台shipyard docker shipyard seanlook 2015年01月05日发布 ...
- 【leetcode】Combination Sum
Combination Sum Given a set of candidate numbers (C) and a target number (T), find all unique combin ...
- 【转】SQL中内连接和外连接
如表 ------------------------------------------------- table1 | table2 | ----------------- ...
- Java web项目的字符集问题
如果在Windows系统下使用eclipse开发Java应用,那么开始的时候我们一般不会考虑编码问题,但是随着不断学习,接触到前端.服务端.数据接口.数据库等更多的组件时,编码问题就逐渐暴露出来了,我 ...
- Java for LeetCode 078 Subsets
Given a set of distinct integers, nums, return all possible subsets. Note: Elements in a subset must ...