
离散化
xuanweiace
一个热爱算法竞赛的弱校ACMer路过。青大本,浙大硕,方向后端开发,菜鸡一枚,奋斗ing...
展开
-
算法笔记 -- 离散化
引入离散化,就是把一些很离散的点给重新分配。举个例子,如果一个坐标轴很长(>1e10),给你1e4个坐标,询问某一个点,坐标比它小的点有多少。很容易就知道,对于1e4个点,我们不必把他们在坐标轴上的位置都表示出来,因为我们比较有多少比它小的话,只需要知道他们之间的相对大小就可以,而不是绝对大小,这,就需要离散化。而离散化又分为两种,分为的两种是对于重复元素来划分的。第一种是重...转载 2018-09-18 15:54:01 · 1574 阅读 · 0 评论 -
【OpenJ_Bailian - 2299 】Ultra-QuickSort (归并排序 或 离散化 + 树状数组)
题干:In this problem, you have to analyze a particular sorting algorithm. The algorithm processes a sequence of n distinct integers by swapping two adjacent sequence elements until the sequence is sor...原创 2018-09-15 13:11:04 · 355 阅读 · 0 评论 -
【CodeForces - 255C】Almost Arithmetical Progression (dp,离散化)
题干:Gena loves sequences of numbers. Recently, he has discovered a new type of sequences which he called an almost arithmetical progression. A sequence is an almost arithmetical progression, if its e...原创 2018-11-09 22:18:18 · 379 阅读 · 0 评论 -
【CodeForces - 485D】Maximum Value (枚举,用数组离散化,数学,取模运算,因子,筛法)
题干:You are given a sequence a consisting of n integers. Find the maximum possible value of (integer remainder of ai divided by aj), where 1 ≤ i, j ≤ n and ai ≥ aj.InputThe first line contains i...原创 2019-02-21 14:16:23 · 348 阅读 · 0 评论 -
【CodeForces - 1199C】MP3(思维,离散化)
题干:One common way of digitalizing sound is to record sound intensity at particular time moments. For each time moment intensity is recorded as a non-negative integer. Thus we can represent a sound f...原创 2019-07-31 21:31:27 · 740 阅读 · 0 评论