
数据结构
文章平均质量分 80
life4711
这个作者很懒,什么都没留下…
展开
-
hihocoder 1232 || 2015北京网络赛F题 树连剖分
http://hihocoder.com/problemset/problem/1232描述"Couple Trees" are two trees, a husband tree and a wife tree. They are named because they look like a couple leaning on each other. They share a原创 2015-09-21 15:37:52 · 1297 阅读 · 0 评论 -
hdu 2665 可持久化线段树求区间第K大值(函数式线段树||主席树)
http://acm.hdu.edu.cn/showproblem.php?pid=2665Problem DescriptionGive you a sequence and ask you the kth big number of a inteval. InputThe first line is the number of the t原创 2015-04-24 11:39:23 · 1720 阅读 · 0 评论 -
hdu 4893 2014多校联合第三场 1007 线段树
http://acm.hdu.edu.cn/showproblem.php?pid=4893原创 2014-07-30 21:21:52 · 699 阅读 · 0 评论 -
AC dreamoj 1011 树状数组+hash维护字符串的前缀和
http://acdream.info/problem?pid=1019Problem DescriptionNow we have a long long string, and we will have two kinds of operation on it.C i y : change the ith letter to y.Q i j : check whet原创 2014-12-26 16:12:13 · 968 阅读 · 0 评论 -
hdu 4747 线段树
http://acm.hdu.edu.cn/showproblem.php?pid=4747Problem DescriptionMex is a function on a set of integers, which is universally used for impartial game theorem. For a non-negative integer set原创 2015-04-16 21:31:41 · 914 阅读 · 0 评论 -
2014多校第四场1006 HDU 4902 Nice boat 线段树 区间更新问题
http://acm.hdu.edu.cn/showproblem.php?pid=4902原创 2014-08-06 15:10:58 · 698 阅读 · 0 评论 -
2014多校联合第9场1011题||hdu 4970 树状数组
http://acm.hdu.edu.cn/showproblem.php?pid=4970Problem DescriptionKingdom Rush is a popular TD game, in which you should build some towers to protect your kingdom from monsters. And now anoth原创 2014-08-19 17:47:26 · 804 阅读 · 0 评论 -
hdu 3973 字符串hash+线段树
http://acm.hdu.edu.cn/showproblem.php?pid=3973Problem DescriptionYou are given some words {Wi}. Then our stupid AC will give you a very long string S. AC is stupid and always wants to know w原创 2014-12-29 19:34:32 · 1256 阅读 · 0 评论 -
hdu5380 贪心+双端队列
http://acm.hdu.edu.cn/showproblem.php?pid=5380Problem DescriptionThere are n+1 cities on a line. They are labeled from city 0 to city n. Mph has to start his travel from city 0, passing city原创 2015-08-18 09:40:47 · 1412 阅读 · 0 评论 -
hdu 4368 树状数组 离线维护
http://acm.hdu.edu.cn/showproblem.php?pid=4638Problem DescriptionThere are n men ,every man has an ID(1..n).their ID is unique. Whose ID is i and i-1 are friends, Whose ID is i and i+1 are f原创 2015-08-29 12:42:03 · 1051 阅读 · 0 评论 -
hdu5289||2015多校联合第一场1002贪心+RMQ
http://acm.hdu.edu.cn/showproblem.php?pid=5289Problem DescriptionTom owns a company and he is the boss. There are n staffs which are numbered from 1 to n in this company, and every staff has原创 2015-07-21 21:06:42 · 1649 阅读 · 5 评论 -
hdu 4123 树形DP+RMQ
http://acm.hdu.edu.cn/showproblem.php?pid=4123Problem DescriptionBob wants to hold a race to encourage people to do sports. He has got trouble in choosing the route. There are N houses and N原创 2015-07-17 21:26:17 · 1078 阅读 · 2 评论 -
hdu 4699 双栈模拟
http://acm.hdu.edu.cn/showproblem.php?pid=4699Problem Description Sample Input8I 2I -1I 1Q 3LDRQ 2 Sample Output23HintThe following diagram shows t原创 2015-08-09 13:42:08 · 1201 阅读 · 0 评论 -
poj 1741 楼教主男人八题之一:树分治
http://poj.org/problem?id=1741DescriptionGive a tree with n vertices,each edge has a length(positive integer less than 1001). Define dist(u,v)=The min distance between node u and v. Give a原创 2015-06-05 12:06:17 · 1617 阅读 · 1 评论 -
HYSBZ 2243 树链剖分(区间更新,区间查询)较难
http://www.lydsy.com/JudgeOnline/problem.php?id=2243Description给定一棵有n个节点的无根树和m个操作,操作有2类:1、将节点a到节点b路径上所有点都染成颜色c;2、询问节点a到节点b路径上的颜色段数量(连续相同颜色被认为是同一段),如“112221”由3段组成:“11”、“222”和“1”。原创 2015-05-30 08:35:39 · 1200 阅读 · 3 评论 -
hdu5195 线段树
http://acm.hdu.edu.cn/showproblem.php?pid=5195Problem DescriptionA topological sort or topological ordering of a directed graph is a linear ordering of its vertices such that for every d原创 2015-03-31 10:47:43 · 1014 阅读 · 0 评论 -
hdu 4339 multiset 或 线段树
http://acm.hdu.edu.cn/showproblem.php?pid=4339Problem DescriptionYou are given two strings s1[0..l1], s2[0..l2] and Q - number of queries.Your task is to answer next queries: 1) 1 a i c原创 2015-02-03 12:50:17 · 831 阅读 · 0 评论 -
NEERC 2015 Southern Subregional G Hiring 树状数组
http://codeforces.com/contest/589/problem/GG. Hiringtime limit per test4 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outp原创 2015-10-23 11:41:59 · 753 阅读 · 0 评论 -
codeforce 6E 线段树+枚举
http://codeforces.com/problemset/problem/6/E原创 2014-06-02 10:31:30 · 1101 阅读 · 0 评论 -
hdu1698 线段树 区间更新
http://acm.hdu.edu.cn/showproblem.php?pid=1698原创 2014-08-01 11:34:04 · 734 阅读 · 0 评论 -
hdu4267分组线段树
http://acm.hdu.edu.cn/showproblem.php?pid=4267Problem DescriptionLet A1, A2, ... , AN be N elements. You need to deal with two kinds of operations. One type of operation is to add a give原创 2015-03-21 09:30:10 · 976 阅读 · 0 评论 -
hdu5489 ||2015合肥网络赛1006 dp+离散化树状数组优化
http://acm.hdu.edu.cn/showproblem.php?pid=5489Removed IntervalTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 656 Accepted Submissi原创 2015-09-30 21:11:52 · 1566 阅读 · 0 评论 -
线段树及其基本操作
下图是对线段[1,10)建立的一棵线段树基本结构1.每个节点都是一个[a,b)的区间,根节点代表了整个所要处理的区间2. 对于每个非叶节点[a,b),令mid = (a + b) / 2;则其左右儿子节点代表的区间为[a,mid),[mid,b)3.二叉的组织结构4. 线段树是一个平衡树,树的高度为logN5. 线段树把区间上的任意一条长度为L的线段都分成不超过原创 2014-06-01 16:49:22 · 2926 阅读 · 3 评论 -
hdu 1166 敌兵布阵 线段树
Problem DescriptionC国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。由于采取了某种先进的监测手段,所以每个工兵营地的人数C国都掌握的一清二楚,每个工兵营地的人数都有可能发生变动,可能增加或减少若干人手,但这些都逃不过C国的监视原创 2014-06-01 16:52:30 · 616 阅读 · 0 评论 -
2014广州网络赛1002||hdu5023 线段树&&状态压缩
http://acm.hdu.edu.cn/showproblem.php?pid=5023原创 2014-09-22 09:46:20 · 766 阅读 · 0 评论 -
hdu4288 离线处理线段树
http://acm.hdu.edu.cn/showproblem.php?pid=4288Problem Description In mathematics and computer science, an algorithm describes a set of procedures or instructions that define a procedure原创 2015-04-06 21:33:36 · 889 阅读 · 0 评论 -
poj 2777 线段树区间更新
http://poj.org/problem?id=2777原创 2014-08-02 15:12:12 · 598 阅读 · 0 评论 -
light oj 1080 线段树和树状数组
http://www.lightoj.com/volume_showproblem.php?problem=1080原创 2014-08-10 15:55:15 · 754 阅读 · 0 评论 -
poj 3468 区间更新 整个区间加一个数和区间求和操作
http://poj.org/problem?id=3468原创 2014-08-01 20:07:47 · 1650 阅读 · 0 评论 -
hdu 5147 树状数组
http://acm.hdu.edu.cn/showproblem.php?pid=5147Problem DescriptionLong long ago, there is a sequence A with length n. All numbers in this sequence is no smaller than 1 and no bigger than n, a原创 2014-12-21 17:30:32 · 1041 阅读 · 0 评论 -
CF19D 线段树+STL各种应用
http://codeforces.com/problemset/problem/19/DDescriptionPete and Bob invented a new interesting game. Bob takes a sheet of paper and locates a Cartesian coordinate system on it as follows:原创 2015-01-07 22:31:30 · 1606 阅读 · 0 评论 -
poj 3237 树链剖分(区间更新,区间查询)
http://poj.org/problem?id=3237DescriptionYou are given a tree with N nodes. The tree’s nodes are numbered 1 through N and its edges are numbered 1 through N − 1. Each edge is associated with a原创 2015-05-29 16:25:04 · 1371 阅读 · 0 评论 -
HYSBZ 1036 树链剖分(单点更新区间求和求最大值)
http://www.lydsy.com/JudgeOnline/problem.php?id=1036Description一棵树上有n个节点,编号分别为1到n,每个节点都有一个权值w。我们将以下面的形式来要求你对这棵树完成一些操作: I. CHANGE u t : 把结点u的权值改为t II. QMAX u v: 询问从点u到点v的路径上的节点的最大权值 III. QSUM u原创 2015-05-29 13:14:05 · 1021 阅读 · 0 评论 -
FZU2082 树链剖分(单点更新区间求值)
http://acm.fzu.edu.cn/problem.php?pid=2082 Problem Description有n座城市,由n-1条路相连通,使得任意两座城市之间可达。每条路有过路费,要交过路费才能通过。每条路的过路费经常会更新,现问你,当前情况下,从城市a到城市b最少要花多少过路费。 Input有多组样例,每组样例第一行输入两个正整数n,m(2原创 2015-05-29 13:08:36 · 836 阅读 · 0 评论 -
uva 11997 priority_queue 应用举例(超省时间!!!)
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=3148Problem KK Smallest SumsYou're given k arrays, each array has k integers. There are kk原创 2014-08-12 17:23:56 · 759 阅读 · 0 评论 -
UVA 11020 multiset、lower_bound、 upper_bound STL里面的排序二叉树
题目大意:有n个人,每个原创 2014-08-11 11:14:17 · 1500 阅读 · 0 评论 -
uva 11995 栈,队列,优先队列,等基本数据结构的应用与理解
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=3146原创 2014-08-11 21:42:56 · 804 阅读 · 0 评论 -
UVA 11991 STL中map、vector的应用
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=3142原创 2014-08-12 09:20:29 · 782 阅读 · 0 评论 -
UVA-LA 3135 2004年北京站C题 STL priority_queue自定义优先顺序优先队列的使用
https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1136原创 2014-08-12 10:18:34 · 953 阅读 · 0 评论 -
UVA 11235 经典RMQ问题
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2176原创 2014-08-10 21:09:33 · 578 阅读 · 0 评论