836. Rectangle Overlap
class Solution
{
public:
bool isRectangleOverlap(vector<int>& rec1, vector<int>& rec2)
{
return rec1[]<rec2[]&&rec2[]<rec1[]&&rec1[]<rec2[]&&rec2[]<rec1[];
}
};
r1left r2left r1right r2right
一个方向上的判定条件:left1<right2&&left2<right1
用两个方向上的判定即可
836. Rectangle Overlap的更多相关文章
- 【Leetcode_easy】836. Rectangle Overlap
problem 836. Rectangle Overlap solution: class Solution { public: bool isRectangleOverlap(vector< ...
- 836. Rectangle Overlap ——weekly contest 85
Rectangle Overlap A rectangle is represented as a list [x1, y1, x2, y2], where (x1, y1) are the coor ...
- #Leetcode# 836. Rectangle Overlap
https://leetcode.com/problems/rectangle-overlap/ A rectangle is represented as a list [x1, y1, x2, y ...
- [LeetCode&Python] Problem 836. Rectangle Overlap
A rectangle is represented as a list [x1, y1, x2, y2], where (x1, y1) are the coordinates of its bot ...
- 836. Rectangle Overlap 矩形重叠
[抄题]: A rectangle is represented as a list [x1, y1, x2, y2], where (x1, y1) are the coordinates of i ...
- 【LeetCode】836. Rectangle Overlap 解题报告(Python)
作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 题目地址:https://leetcode.com/problems/rectangle ...
- [LeetCode] Rectangle Overlap 矩形重叠
A rectangle is represented as a list [x1, y1, x2, y2], where (x1, y1) are the coordinates of its bot ...
- [Swift]LeetCode836. 矩形重叠 | Rectangle Overlap
A rectangle is represented as a list [x1, y1, x2, y2], where (x1, y1) are the coordinates of its bot ...
- LeetCode - Rectangle Overlap
A rectangle is represented as a list [x1, y1, x2, y2], where (x1, y1) are the coordinates of its bot ...
随机推荐
- LibreOJ 6285. 数列分块入门 9
题目链接:https://loj.ac/problem/6285 其实一看到是离线,我就想用莫队算法来做,对所有询问进行分块,但是左右边界移动的时候,不会同时更新数字最多的数,只是后面线性的扫了一遍, ...
- ZOJ2018/4月月赛G题Traffic Light(广搜)
题意:首先T组数据,每组数据包括:第一行:一个n,m,然后下面有一个n行m列的01矩阵. 最后一行输入四个数字,分别是起点的横纵坐标,终点的横纵坐标.询问从起点到终点,最少要几步,如果到不了输出-1 ...
- Maximum Gap (ARRAY - SORT)
QUESTION Given an unsorted array, find the maximum difference between the successive elements in its ...
- Unity3D无限奔跑者Playmaker v1.5
这款功能丰富的移动准备包内含使您自己的各种各样的3D游戏运行的一切要素.无需编程! 功能 1 - 响应式滑动控制2 - 投掷炮弹3 - 可破坏物体4 - 能力提升道具- 金币磁铁- 护盾- 继续密钥- ...
- 100-days: The one day
Title:In tech race with China, US universities may lose a vital edge in tech race with 与...的科技比赛中 e ...
- 《centos系列》ubuntu终端链接centos服务器
首先你得知道centos的账户密码:如果你不知道可以直接在centos下使用root用户: passwd 用户名 直接更新用户的密码. 然后在ubuntu终端(前提是已经安装了ssh): ssh ad ...
- win10装回win7。PE下把原来的系统盘格掉,再安装hdd,重启就好了
win10装回win7.安装文件解压到某盘根目录,然后 PE下把原来的系统盘格掉,再安装hdd,重启就好了
- 数据节点-df 无法输出结果
1. 删除了 a 机器的/opt/data 目录 2.b与c 机器挂载了 a机器的/opt/data 3.df -h 无法输出结果 最后参考:http://blog.csdn.net/lufeisan ...
- python 爬取网页基础 requests使用
pip install requests 安装requests库 基本顺序: import requests r=requests.get("url路径") r.status_c ...
- php libev扩展使用
在WorkerMan源码分析 - 实现最简单的原型文章中提到了libevent网络库,前者和libev都是事件驱动编程库高性能.简单说libev对libevent做了改进和精简.libevent使用全 ...