![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
ACM__Hash
文章平均质量分 75
Element-YoNg
每天晚上疲劳的睡在床上时,才感觉真真切切地过了一天。压力不是有人比你努力,而是比你牛逼几倍的人依然比你努力。即使看不到未来,也依然相信,自己选的人生错不了。第二天叫醒我的不是闹钟,其实,还是梦想。
展开
-
HDU 1541 Stars (树状数组)
Problem DescriptionAstronomers often examine star maps where stars are represented by points on a plane and each star has Cartesian coordinates. Let the level of a star be an amount of the stars tha原创 2014-08-18 22:59:32 · 728 阅读 · 0 评论 -
HDU 3333 Turing Tree (离散化+离线处理+树状数组)
Problem 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 n原创 2014-08-20 10:51:56 · 763 阅读 · 0 评论 -
NOIP 提高组2013 火柴排队 (Vijos P1842)
描述涵涵有两盒火柴,每盒装有 n 根火柴,每根火柴都有一个高度。现在将每盒中的火柴各自排成一列,同一列火柴的高度互不相同,两列火柴之间的距离定义为:∑ i=1 n (a i −b i ) 2 ,其中a i 表示第一列火柴中第 i 个火柴的高度,b i 表示第二列火柴中第 i 个火柴的高度。 每列火柴中相邻两根火柴的位置都可以交换,请你通过交换使得两列火柴之间的距离原创 2014-08-17 11:58:15 · 1116 阅读 · 0 评论 -
BZOJ 1452: [JSOI2009]Count (二维树状数组)
DescriptionInputOutputSample InputSample Output12HINT二维树状数组的简单应用,c数组的第一维坐标相当于哈希。如果是修改操作,修改前 将当前的值的个数以及祖先都减1, 修改后将个数加1.#include #include #include #i原创 2014-08-21 23:49:07 · 744 阅读 · 0 评论 -
CF#215 DIV2: B. Sereja and Suffixes
Sereja has an array a, consisting of n integers a1,a2,..., an. The boy cannot sit and do nothing, he decided to study an array. Sereja took a piece of paper and wrote out m integers l1, l2, ..原创 2014-08-15 11:59:42 · 600 阅读 · 0 评论 -
求逆序对(线段树版)
一个序列a1,a2,a3...aN,求出满足:ai > aj 且 i 一个最容易想到的方法就是枚举所有的i,j看看是否满足,显然是O(n^2)的复杂度。不够好。可以这样考虑,开一个数组保存这n个数出现的位置和对应的次数,这个数组要开到a数组里最大的那个数MAX,也就是hash,初始状态数组里没有元素,每个数对应的个数都是0.如果考虑第i个数,找到比它大的所有的数 的个数,查找的范围即原创 2014-08-16 22:46:23 · 5930 阅读 · 0 评论 -
CF #261 Div2 D. Pashmak and Parmida's problem (离散化+逆序对+线段树)
Parmida is a clever girl and she wants to participate in Olympiads this year. Of course she wants her partner to be clever too (although he's not)! Parmida has prepared the following test problem for原创 2014-08-16 21:04:00 · 646 阅读 · 0 评论 -
求逆序对 (树状数组版)
基本思想和线段树求解逆序数是一样的,前一篇《求逆序对 线段树版》也介绍过,先对输入数组离散,数组里的元素都不相同可以直接hash,存在相同的数话可以采用二分。离散化后对于每个f[i],找到f[i]+1~ n中的个数,也就是到i这个位置,一共有多少比f[i]大的数,统计之后在将f[i]的位置上的数量加1。这样一来统计的就是类似a[i]~n的和,可以想象成 把树状数组反过来统计,即统计的时候加原创 2014-08-18 14:53:05 · 1048 阅读 · 0 评论 -
CF #261 div2 D. Pashmak and Parmida's problem (树状数组版)
Parmida is a clever girl and she wants to participate in Olympiads this year. Of course she wants her partner to be clever too (although he's not)! Parmida has prepared the following test problem for原创 2014-08-19 00:32:26 · 1040 阅读 · 0 评论