![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
树状数组
古城白衣少年i
这个作者很懒,什么都没留下…
展开
-
POJ 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...原创 2019-08-05 22:23:25 · 112 阅读 · 0 评论 -
HDU - 4217(树状数组or线段树)
题目:Data structure is one of the basic skills for Computer Science students, which is a particular way of storing and organizing data in a computer so that it can be used efficiently. Today let me in...原创 2019-08-08 22:14:07 · 146 阅读 · 0 评论 -
HDU-4417 (树状数组or线段树)-Super Mario
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=44171.线段树+离散处理这道题主要的地方就是离线处理数据,具体想法: ① 先把所有位置的高度都存下来,然后排序,注意保存下标; ② 把所有询问存下来,然后按照询问的高度进行排序,同注意保存下标; ③ 对于排序后的每次询问的处理:由于每个位置的高度都已经存了下来并且进行了排序,...原创 2019-08-06 22:22:23 · 134 阅读 · 0 评论 -
POJ 3067(树状数组)
题目:Japan plans to welcome the ACM ICPC World Finals and a lot of roads must be built for the venue. Japan is tall island with N cities on the East coast and M cities on the West coast (M <= 1000,...原创 2019-08-09 08:51:54 · 108 阅读 · 0 评论 -
hdu-5877-Weak Pair (树状数组+dfs序+离散化) 我感觉这个题太好了!
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5877题目大意:给你一棵树,有n个节点,每个点都有对应的ai,不同结点之间有关系,问其上的任意两个节点i,j,这两个节点满足那个关系,且ai*aj<=k。这样的节点对有多少个。解题思路:因为ai的值较大,所以需要离散化(很重要,而且我写了好长时间,题意都理解错了,真是够了)。我们可...原创 2019-08-20 18:06:58 · 118 阅读 · 0 评论 -
POJ - 2182 - Lost Cows(线段树or树状数组or暴力)
题目链接:http://poj.org/problem?id=2182题目:N (2 <= N <= 8,000) cows have unique brands in the range 1..N. In a spectacular display of poor judgment, they visited the neighborhood 'watering hole' ...原创 2019-08-27 11:04:52 · 126 阅读 · 0 评论