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的网格,让你 ...
随机推荐
- spingMVC<1>-xml文件配置
---恢复内容开始---
- WPF 任务栏图标闪烁提醒
using System; using System.Collections.Generic; using System.Linq; using System.Runtime.InteropServi ...
- git基础知识总结
1,clone git clone https://github.com/KoMiles/helloword helloword 2,pull git pull 3,commit git commit ...
- Linux netstat +awk 看攻击IP
netstat -n | awk '/^tcp/ {n=split($(NF-1),array,":");if(n<=2)++S[array[(1)]];else++S[a ...
- Floyd算法 及其运用
#include<stdio.h> ][]; ][]; void floyd(int n) { ;k<=n;k++) { ;i<=n;i++) { ;j<=n;j++) ...
- 使用Discuz关键词服务器实现PHP中文分词
不同于使用自己的服务器进行分词,Discuz!在线中文分词服务是基于API返回分词结果的.在项目中,我们只需要一个函数即可方便地进行分词.关键词提取.以下是根据Discuz!在线分词服务API写的函数 ...
- centos7 安装kvm, 并创建虚拟机
# yum –y install qemu-kvm qemu-img bridge-utils # yum –y install libvirt virt-install virt-manager # ...
- maven3 junit4 spring3 jdk8 :junit一直报错,害的我几个星期都是这个错,你妹的!
[org.springframework.test.context.junit4.SpringJUnit4ClassRunner]SpringJUnit4ClassRunner constructor ...
- Eclipse 项目红色叹号:Build Path Problem
Description Resource Path Location TypeA cycle was detected in the build path of project 'shgl-categ ...
- 安装完mysql后用root不能su成mysql
现象: debian的机器用aptitude install mysql-server-5.1 后,用id mysql 可看出已经建了mysql用户,但是用root来su mysql 不成功,/var ...