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的网格,让你 ...
随机推荐
- svn代码回滚命令
代码回滚提交: 比如要把73回滚到68 svn merge -r 73:68 http://my.repository.com/my/project/trunk 然后commit就行了 svn com ...
- WPF TreeView绑定字典集合
<TreeView Name="Tree" HorizontalAlignment="Left" Height="269" Width ...
- C语言中strstr函数
头文件:#include <string.h> strstr()函数用来检索子串在字符串中首次出现的位置,其原型为: char *strstr( char *str, char * ...
- apache配置多个虚拟主机
设置apache 多个虚拟目录记录 #配置第2个虚拟目录<VirtualHost 127.0.0.2:80>ServerName www.xx.comDocumentRoot " ...
- POJ 1054 The Troublesome Frog
The Troublesome Frog Time Limit: 5000MS Memory Limit: 100000K Total Submissions: 9581 Accepted: 2883 ...
- 如何让Ubuntu系统支持WebP图片格式
本文主要向大家介绍如何让 Ubuntu 系统支持查看 WebP 图片格式,以及如何将 WebP 转为 JPEG 或 PNG 图片格式的方法. 什么是WebP图片 Google开发并推出 WebP 图片 ...
- NGUI 学习笔记实战之二——商城数据绑定(Ndata)
上次笔记实现了游戏商城的UI界面,没有实现动态数据绑定,所以是远远不够的.今天采用NData来做一个商城. 如果你之前没看过,可以参考上一篇博客 NGUI 学习笔记实战——制作商城UI界面 ht ...
- iOS高级必备
1.你使用过Objective-C的运行时编程(Runtime Programming)么?如果使用过,你用它做了什么?你还能记得你所使用的相关的头文件或者某些方法的名称吗? Objecitve-C的 ...
- HDOJ 1203 I NEED A OFFER!(01背包)
10397507 2014-03-25 23:30:21 Accepted 1203 0MS 480K 428 B C++ 泽泽 题目链接:http://acm.hdu.edu.cn/showprob ...
- 【OpenStack】OpenStack系列7之Nova详解
源码下载.安装 参考: https://github.com/yongluo2013/osf-openstack-training/blob/master/installation/openstack ...