你看看你有多菜,一点线段树的小小的运用,就不会写了; 题意:如果矩阵有交集,输出1,否则输出0(不包含内嵌); 思路:本题求交集,还得不包括内嵌的情况; 做过一道是求面积的题。跟这道类似,但在这里定义的方式跟那道题定的相反。 这里把下面的线定为了-1,上面定为了1; 在这道题里,先把矩阵的横向边按上 ...
分类:
其他好文 时间:
2019-10-04 17:00:32
阅读次数:
89
题目链接 :http://acm.hdu.edu.cn/showproblem.php?pid=1506 Problem Description A histogram is a polygon composed of a sequence of rectangles aligned at a co ...
分类:
其他好文 时间:
2019-09-28 12:43:03
阅读次数:
68
传送门 看到 $n<=5000$,直接暴力枚举左右两条竖线 然后考虑怎么计算高度在某个范围内,左端点小于等于某个值,右端点大于等于某个值的横线数量 直接用权值树状数组维护当前高度在某个区间内的横线数量 考虑先固定左边的竖线,然后枚举从左到右枚举右边的竖线,那么随着右边竖线的右移,合法的横线(右端点大 ...
分类:
其他好文 时间:
2019-09-27 15:12:16
阅读次数:
70
原题链接在这里:https://leetcode.com/problems/number-of-corner-rectangles/ 题目: Given a grid where each entry is only 0 or 1, find the number of corner rectang ...
分类:
其他好文 时间:
2019-08-31 13:02:27
阅读次数:
97
You are given 4n4n sticks, the length of the ii-th stick is aiai. You have to create nn rectangles, each rectangle will consist of exactly 44 sticks f ...
分类:
其他好文 时间:
2019-08-27 09:12:38
阅读次数:
87
B. Equal Rectangles B. Equal Rectangles 题意:给你4*n个木棒,问你能否组成n个面积相等的矩形。 题解:排序,若能组成,那么矩形的面积一定是 a[0]*a[n*4-1] ,依次用最小的乘以最大的判断面积即可 #include<iostream> #includ ...
分类:
其他好文 时间:
2019-08-22 21:53:29
阅读次数:
77
B. Equal Rectangles 给定4*N个数,是否能构成N个矩形 面积均相等 每次取两个大的,两个小的 ...
分类:
其他好文 时间:
2019-08-14 23:20:25
阅读次数:
90
Problem Description A histogram is a polygon composed of a sequence of rectangles aligned at a common base line. The rectangles have equal widths but ...
分类:
其他好文 时间:
2019-05-12 19:49:00
阅读次数:
91
Description A histogram is a polygon composed of a sequence of rectangles aligned at a common base line. The rectangles have equal widths but may have ...
分类:
其他好文 时间:
2019-05-03 18:25:16
阅读次数:
86