
离散化
文章平均质量分 79
Viscu
勤能补拙。
展开
-
codevs3044 矩形面积求并(线段数+扫描线+离散化)
题目描述 Description输入n个矩形,求他们总共占地面积(也就是求一下面积的并)输入描述 Input Description可能有多组数据,读到n=0为止(不超过15组)每组数据第一行一个数n,表示矩形个数(n<=100)接下来n行每行4个实数x1,y1,x2,y1(0 <= x1 < x2 <= 100000;0 <= y1 < y2 <= 100000),表示矩形的左下角坐标和右上角坐标原创 2016-12-04 19:05:18 · 781 阅读 · 0 评论 -
关于离散化 java实现
离散化 public class Discretization { public static int lower_bound(int[] arr,int target){ //找到第一个大于等于x的数的位置 int l=0; int r=arr.length; while (l&amp;amp;lt;r){ int mid...原创 2018-09-11 19:21:00 · 1278 阅读 · 0 评论 -
POJ2528 Mayor's posters 线段树+离散化
The citizens of Bytetown, AB, could not stand that the candidates in the mayoral election campaign have been placing their electoral posters at all places at their whim. The city council has finall...原创 2018-09-16 00:46:38 · 319 阅读 · 0 评论 -
leetcode 315. 计算右侧小于当前元素的个数 离散化+线段树
给定一个整数数组 nums,按要求返回一个新数组 counts。数组 counts 有该性质: counts[i] 的值是 nums[i] 右侧小于 nums[i] 的元素的数量。 示例: 输入: [5,2,6,1] 输出: [2,1,1,0] 解释: 5 的右侧有 2 个更小的元素 (2 和 1). 2 的右侧仅有 1 个更小的元素 (1). ...原创 2018-09-11 00:44:58 · 546 阅读 · 0 评论 -
POJ 1151 Atlantis 线段树+离散化+扫描线 (java实现)
Description There are several ancient Greek texts that contain descriptions of the fabled island Atlantis. Some of these texts even include maps of parts of the island. But unfortunately, these ...原创 2018-09-13 17:32:03 · 636 阅读 · 0 评论