
数据结构_主席树
SCUT_Pein
这个作者很懒,什么都没留下…
展开
-
POJ2761--Feed the dogs
DescriptionWind loves pretty dogs very much, and she has n pet dogs. So Jiajia has to feed the dogs every day for Wind. Jiajia loves Wind, but not the dogs, so Jiajia use a special way to feed the d原创 2013-11-14 21:32:13 · 1152 阅读 · 0 评论 -
POJ2104--K-th Number(主席树)
DescriptionYou are working for Macrohard company in data structures department. After failing your previous task about key insertion you were asked to write a new data structure that would be able原创 2014-03-17 19:20:22 · 655 阅读 · 0 评论 -
SPOJ10628--COT(树上第K大)主席树
You are given a tree with N nodes.The tree nodes are numbered from 1 to N.Each node has an integer weight.We will ask you to perform the following operation:u v k : ask for the kth minimum wei原创 2014-04-17 16:32:18 · 998 阅读 · 0 评论 -
SPOJ3267--D-query(离线线段树||在线主席树)
Given a sequence of n numbers a1, a2, ..., an and a number of d-queries. A d-query is a pair (i, j) (1 ≤ i ≤ j ≤ n). For each d-query (i, j), you have to return the number of distinct elements in th原创 2014-04-16 10:36:50 · 947 阅读 · 0 评论 -
大视野1901: Zju2112 (树状数组+主席树)
Description给定一个含有n个数的序列a[1],a[2],a[3]……a[n],程序必须回答这样的询问:对于给定的i,j,k,在a[i],a[i+1],a[i+2]……a[j]中第k小的数是多少(1≤k≤j-i+1),并且,你可以改变一些a[i]的值,改变后,程序还能针对改变后的a继续回答上面的问题。你需要编一个这样的程序,从输入文件中读入序列a,然后读入一系列的指令,包括询问指令原创 2014-04-18 16:12:44 · 907 阅读 · 0 评论