Gym 100531G Grave(水题)
题意:给定一个大矩形,再给定在一个小矩形,然后给定一个新矩形的长和高,问你能不能把这个新矩形放到大矩形里,并且不与小矩形相交。
析:直接判定小矩形的上下左右四个方向,能不能即可。
代码如下:
- #pragma comment(linker, "/STACK:1024000000,1024000000")
- #include <cstdio>
- #include <string>
- #include <cstdlib>
- #include <cmath>
- #include <iostream>
- #include <cstring>
- #include <set>
- #include <queue>
- #include <algorithm>
- #include <vector>
- #include <map>
- #include <cctype>
- #include <cmath>
- #include <stack>
- #define debug puts("+++++")
- //#include <tr1/unordered_map>
- #define freopenr freopen("in.txt", "r", stdin)
- #define freopenw freopen("out.txt", "w", stdout)
- using namespace std;
- //using namespace std :: tr1;
- typedef long long LL;
- typedef pair<int, int> P;
- const int INF = 0x3f3f3f3f;
- const double inf = 0x3f3f3f3f3f3f;
- const LL LNF = 0x3f3f3f3f3f3f;
- const double PI = acos(-1.0);
- const double eps = 1e-8;
- const int maxn = 50000 + 5;
- const LL mod = 1e3 + 7;
- const int N = 1e6 + 5;
- const int dr[] = {-1, 0, 1, 0, 1, 1, -1, -1};
- const int dc[] = {0, 1, 0, -1, 1, -1, 1, -1};
- const char *Hex[] = {"0000", "0001", "0010", "0011", "0100", "0101", "0110", "0111", "1000", "1001", "1010", "1011", "1100", "1101", "1110", "1111"};
- inline LL gcd(LL a, LL b){ return b == 0 ? a : gcd(b, a%b); }
- inline int gcd(int a, int b){ return b == 0 ? a : gcd(b, a%b); }
- inline int lcm(int a, int b){ return a * b / gcd(a, b); }
- int n, m;
- const int mon[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
- const int monn[] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
- inline int Min(int a, int b){ return a < b ? a : b; }
- inline int Max(int a, int b){ return a > b ? a : b; }
- inline LL Min(LL a, LL b){ return a < b ? a : b; }
- inline LL Max(LL a, LL b){ return a > b ? a : b; }
- inline bool is_in(int r, int c){
- return r >= 0 && r < n && c >= 0 && c < m;
- }
- int main(){
- freopen("grave.in", "r", stdin);
- freopen("grave.out", "w", stdout);
- int x1, y1, x2, y2, x3, y3, w, h, x4, y4;
- while(cin >> x1 >> y1 >> x2 >> y2){
- cin >> x3 >> y3 >> x4 >> y4;
- cin >> w >> h;
- bool ok = false;
- if(y2 - y4 >= h && x2 - x1 >= w) ok = true;
- else if(y3 - y1 >= h && x2 - x1 >= w) ok = true;
- else if(x3 - x1 >= w && y2 - y1 >= h) ok = true;
- else if(x2 - x4 >= w && y2 - y1 >= h) ok = true;
- printf("%s\n", ok ? "Yes" : "No");
- }
- return 0;
- }
Gym 100531G Grave(水题)的更多相关文章
- Codeforces Gym 100531G Grave 水题
Problem G. Grave 题目连接: http://codeforces.com/gym/100531/attachments Description Gerard develops a Ha ...
- UVaLive 6591 && Gym 100299L Bus (水题)
题意:略. 析:不解释,水题. 代码如下: #pragma comment(linker, "/STACK:1024000000,1024000000") #include < ...
- Codeforces Gym 100286I iSharp 水题
Problem I. iSharpTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/ ...
- CodeForces Gym 100685C Cinderella (水题)
题意:给定 n 个杯子,里面有不同体积的水,然后问你要把所有的杯子的水的体积都一样,至少要倒少多少个杯子. 析:既然最后都一样,那么先求平均数然后再数一下,哪个杯子的开始的体积就大于平均数,这是一定要 ...
- Two Operations Gym - 102263M 优先队列水题
Two Operations Gym - 102263M Ayoub has a string SS consists of only lower case Latin letters, and he ...
- codeforces Gym 100187L L. Ministry of Truth 水题
L. Ministry of Truth Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100187/p ...
- 水题 Gym 100553K Knockout Racing
题目传送门 /* 题意:有若干个点在一个区间内来回移动,1m/s. 水题:n^2的复杂度能解决,注意时间可能大于一个周期,要取模 */ #include <cstdio> #include ...
- Codeforces Gym 100286G Giant Screen 水题
Problem G.Giant ScreenTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/con ...
- 每日一刷(2018多校水题+2016icpc水题)
11.9 线段树 http://acm.hdu.edu.cn/showproblem.php?pid=6315 求逆序对个数 http://acm.hdu.edu.cn/showproblem.php ...
随机推荐
- 12.3——类作用域,构造函数,友元,static类成员
类作用域: (1)成员函数在类外定义时,因为函数体还有形参列表都出现在成员名之后,都是在类作用域内定义,所以不用加域作用符 来引用其他的成员. (2)函数的返回值不一定需要在类的作用域中,但是若是返回 ...
- free delete malloc new(——高品质量程序设计指南第16章)
free和delete只是把指针所指向的内存给释放掉了,但是指针本身并没有被删掉. 所以在释放掉内存后一定要记得将指针指向NULL ,动态内存分配不会自动的释放,一定要记得free掉
- 寒武纪camp Day2
补题进度:8/10 A(计数+BIT) 题意: 给一个长度为n的数组a[],任意选0<=i<=j<n,将a[i]~a[j]从小到大排序,形成新的数组.问有多少个不同的新数组. N,a ...
- zookeeper原理浅析(二)
参考:https://www.cnblogs.com/leocook/p/zk_1.html 代码:https://github.com/littlecarzz/zookeeper 1. 数据模型 1 ...
- mysql查看存储过程show procedure status;
1.mysql查看存储过程(函数) 2.MySQL查看触发器 查看触发器 语法:SHOW TRIGGERS [FROM db_name] [LIKE expr] 实例:SHOW TRIGGERS\G ...
- 搜索引擎keyword智能提示的一种实现
问题背景 搜索关键字智能提示是一个搜索应用的标配.主要作用是避免用户输入错误的搜索词,并将用户引导到相应的关键词上,以提升用户搜索体验. 美团CRM系统中存在数以百万计的商家,为了让用户高速查找到目标 ...
- 【转】AOP
原文:http://blog.csdn.net/zhoudaxia/article/details/38502347 .---------------------------------------- ...
- Registration system
Registration system 时间限制:1000 ms | 内存限制:65535 KB 难度:2 描写叙述 A new e-mail service "Berlandesk&q ...
- win8 metro 自己写摄像头录像项目
这是要求不适用CameraCaptureUI等使用系统自带的 camera UI界面.要求我们自己写调用摄像头摄像的方法,如今我把我的程序贴下: UI界面的程序: <Page x:Class= ...
- webservice0基础
在学习webservice的时候,常常将ns和url花了好久时间才理解过来,这里备份下. 首先定义接口: @WebService public interface IService { @WebRes ...