- 博客(9)
- 收藏
- 关注
原创 poj 3368 Frequent values
题目链接:点击打开链接DescriptionYou are given a sequence of n integers a1 , a2 , ... , an in non-decreasing order. In addition to that, you are given several queries consisting of indices i and j
2016-10-31 21:58:06 270
原创 poj 1201 intervals
题目链接:点击打开链DescriptionYou are given n closed, integer intervals [ai, bi] and n integers c1, ..., cn. Write a program that: reads the number of intervals, their end points and integers c1, .
2016-10-26 20:38:32 315
转载 主席树解析
转载:http://www.cnblogs.com/zyf0163/p/4749042.html自己的话:现在感觉对主席树模模糊糊的,有点抽象到底是怎么回事,但还是有所收获主席树又称函数式线段树,顾名思义,也就是通过函数来实现的线段树,至于为什么叫主席树,那是因为是fotile主席创建出来的这个数据结构(其实貌似是当初主席不会划分树而自己想出来的另一个处理方式。。。。是不是很吊呢?
2016-10-20 21:08:31 526
原创 poj 1195 Mobile phones
题目链接:点击打开链接DescriptionSuppose that the fourth generation mobile phone base stations in the Tampere area operate as follows. The area is divided into squares. The squares form an S * S matrix w
2016-10-18 19:54:58 392
原创 poj 3122 Apple Tree
题目链接:点击打开链接#include #include#include#includeusing namespace std;///直接开vectormp[100005]会tle don't know why?typedef vectorve;vectormp(100005);int forck[100005];int c[100005];int n;int ke
2016-10-17 20:53:51 280
转载 树状数组详解
对于普通数组,其修改的时间复杂度位O(1),而求数组中某一段的数值和的时间复杂度为O(n),因此对于n的值过大的情况,普通数组的时间复杂度我们是接受不了的。在此,我们引入了树状数组的数据结构,它能在O(logn)内对数组的值进行修改和查询某一段数值的和。转载地址:http://blog.csdn.net/ljd4305/article/details/10101535树状数组是一个查询
2016-10-17 19:53:56 374
原创 线段树求逆序数(模板)
经过两天的调试终于弄明白了线段树求逆序数,;说一下思路: 首先建树是根据序列中最大的数开辟的区间,(如果数太大 离散化)。 逆序对可以表示成一个数前面有几个比这个数大的数,就表示这个数所形成的逆序对数,(听绕口的,需要模拟一下); 数列a[i],将数列a[i]添加到线段树中,并将区间中有它的区间的num+1,意思是在当前的区间上有几个值了,记录下来。 因为
2016-10-11 11:31:37 1009
原创 codeforce 1C Ancient Berland Circus
题目链接:点击打开链接DescriptionNowadays all circuses in Berland have a round arena with diameter 13 meters, but in the past things were different.In Ancient Berland arenas in circuses were shaped
2016-10-10 20:02:46 411
原创 Codeforce 1B Spreadsheets
题目链接:点击打开链接DescriptionIn the popular spreadsheets systems (for example, in Excel) the following numeration of columns is used. The first column has number A, the second — number B, etc. ti
2016-10-10 10:56:52 413
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人