Codeforces 560B Gerald is into Art
来源:互联网 发布:永宏plc用什么编程电缆 编辑:程序博客网 时间:2024/04/29 23:45
题目链接:http://codeforces.com/problemset/problem/560/B
题 意:给你三个矩形的长和宽,问后两个能否放在第一个中(且不重叠)
思 路:将八种情况列出。
#include <iostream>using namespace std;#include <string.h>#include <stdio.h>#include <queue>#include <algorithm>int main(){ int n,m; while(scanf ( "%d %d", &n, &m ) != EOF ) { int x,y,a,b; int f=0; scanf ( "%d%d%d%d",&x,&y,&a,&b); if(y+b<=m) { if(max(x,a)<=n) f=1;//注意不能改x,y,a,b,n,m的值 } if(y+b<=n) { if(max(x,a)<=m) f=1; } if(x+a<=n) { if(max(y,b)<=m) f=1; } if(x+a<=m) { if(max(y,b)<=n) f=1; } if(y+a<=m) { if(max(x,b)<=n) f=1; } if(y+a<=n) { if(max(x,b)<=m) f=1; } if(x+b<=n) { if(max(y,a)<=m) f=1; } if(x+b<=m) { if(max(y,a)<=n) f=1; } if(f) printf("YES\n"); else printf("NO\n"); } return 0;}
0 0
- Codeforces 560B Gerald is into Art
- CodeForces 560B Gerald is into Art
- CodeForces 560B Gerald is into Art
- CodeForces - 560B Gerald is into Art
- CodeForces#313 B. Gerald is into Art
- Codeforces 560B Gerald is into Art 放矩形
- Codeforces 560B Gerald is into Art(构造性算法)
- Codeforces 560B Gerald is into Art(相片摆放模拟)
- CodeForces 560B Gerald is into Art【水题】
- 【45.65%】【codeforces 560B】Gerald is into Art
- Codeforces 560B Gerald is into Art【思维、分类讨论】
- B. Gerald is into Art
- B. Gerald is into Art
- Codeforces Round #313 (Div. 2) B. Gerald is into Art
- Codeforces Round #313 (Div. 2)-B. Gerald is into Art
- Code Forces 560 B. Gerald is into Art(水~)
- Code Forces 560B Gerald is into Art
- Gerald is into Art
- 二叉树比较
- 如何将java程序设置为服务程序
- URLConnection在Tomcat中get、post请求消息乱码
- python socket传文件
- hdu 4287——Intelligent IME
- Codeforces 560B Gerald is into Art
- 剑指Offer面试题3(Java版):二维数组中的查找
- nyoj 会场安排问题
- Android : ”找不到符号“错误
- 自己写一个快速开发android模板
- maven项目调试Junit类
- UIPickerView的使用
- cocos2dx中的回调函数CC_CALLBACK_*
- fiddler录制http请求