摘要:Dynamic RankingsTime Limit:10 Seconds Memory Limit:32768 KBThe Company Dynamic Rankings has developed a new kind of computer that is no longer satisfied with the query like to simply find the k-th smallest number of the given N numbers. They have developed a more powerful system such that for N numb
阅读全文
摘要:10628. Count on a treeProblem code: COTYou are given a tree withNnodes.The tree nodes are numbered from1toN.Each node has an integer weight.We will ask you to perform the following operation:u v k: ask for the kth minimum weight on the path from nodeuto nodevInputIn the first line there are two inte
阅读全文
摘要:3267. D-queryProblem code: DQUERYEnglishVietnameseGiven a sequence of n numbers a1, a2, ..., anand 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 the subsequence ai, ai+1, ..., aj.InputLine 1: n (1 ≤ n
阅读全文
摘要:查询区间第K大,而且没有修改。使用划分树是可以做的。作为主席树的入门题,感觉太神奇了,Orz 1 /* *********************************************** 2 Author :kuangbin 3 Created Time :2013-9-4 20:13:20 4 File Name :POJ2104.cpp 5 ************************************************ */ 6 7 #include 8 #include 9 #include 10 #incl...
阅读全文