离散
文章平均质量分 61
云淡风轻jzl
一路脚踏实地,不忘仰望星空。
展开
-
力扣2122-还原原数组-枚举+离散化
题目描述:Alice 有一个下标从 0 开始的数组 arr ,由 n 个正整数组成。她会选择一个任意的 正整数 k 并按下述方式创建两个下标从 0 开始的新整数数组 lower 和 higher :对每个满足 0 <= i < n 的下标 i ,lower[i] = arr[i] - k对每个满足 0 <= i < n 的下标 i ,higher[i] = arr[i] + k不幸地是,Alice 丢失了全部三个数组。但是,她记住了在数组 lower 和 higher 中原创 2022-01-01 18:03:23 · 3468 阅读 · 0 评论 -
CF 540E-Infinite Inversions-区间离散+线段树
(传送门)DescriptionThere is an infinite sequence consisting of all positive integers in the increasing order: p = {1, 2, 3, …}. We performed n swap operations with this sequence. A swap(a, b) is an ope...原创 2019-08-07 15:32:40 · 178 阅读 · 0 评论 -
HDU 3333-Turing Tree-线段树+离散+离线
DescriptionAfter inventing Turing Tree, 3xian always felt boring when solving problems about intervals, because Turing Tree could easily have the solution. As well, wily 3xian made lots of new proble...原创 2019-08-04 17:53:05 · 177 阅读 · 0 评论 -
POJ 2528-Mayor's posters-线段树+离散化
DescriptionThe 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 h...原创 2019-08-04 17:42:14 · 158 阅读 · 0 评论 -
洛谷 P2633-Count on a tree-主席树+最近公共祖先LCA
题目描述:给定一棵N个节点的树,每个点有一个权值,对于M个询问(u,v,k),你需要回答u xor lastans和v这两个节点间第K小的点权。其中lastans是上一个询问的答案,初始为0,即第一个询问的u是明文。输入描述:第一行两个整数N,M。第二行有N个整数,其中第i个整数表示点i的权值。后面N-1行每行两个整数(x,y),表示点x到点y有一条边。最后M行每行两个整数(u,v,k...原创 2019-08-29 10:03:21 · 271 阅读 · 0 评论 -
计蒜客-so easy-离散化+并查集
DescriptionThere are n points in an array with index from 1 to n, and there are two operations to those points.1: 1 x marking the point x is not available2: 2 x query for the index of the first ava...原创 2019-09-08 10:31:44 · 220 阅读 · 0 评论