随笔分类 - 数据结构
摘要:Problem DescriptionGiven n integers.You have two operations:U A B: replace the Ath number by B. (index counting from 0)Q A B: output the length of the...
        阅读全文
                
摘要:Problem DescriptionThere is a piece of grids land of size n×m. Chandler and his team take responsibility to guard it. There are some searchlights on some pieces and each of them has a capability to lighten a distance towards four directions: north, south, east and west. Different searchlight ha
        阅读全文
                
摘要:题目链接:http://www.lydsy.com/JudgeOnline/problem.php?id=1503DescriptionOIER公司是一家大型专业化软件公司,有着数以万计的员工。作为一名出纳员,我的任务之一便是统计每位员工的工资。这本来是一份不错的工作,但是令人郁闷的是,我们的老板反...
        阅读全文
                
摘要:Problem DescriptionThere's a queue obeying the first in first out rule. Each time you can either push a number into the queue (+i), or pop a number out from the queue (-i). After a series of operation, you get a sequence (e.g. +1 -1 +2 +4 -2 -4). We call this sequence a queue sequence.Now you ar
        阅读全文
                
摘要:Problem DescriptionWe have met so many problems on the tree, so today we will have a query problem on a set of trees.There are N nodes, each node will...
        阅读全文
                
摘要:You are given a tree (an acyclic undirected connected graph) withNnodes, and edges numbered 1, 2, 3...N-1.We will ask you to perfrom some instructions of the following form:CHANGE i ti: change the cost of the i-th edge to tiorQUERY a b: ask for the maximum edge cost on the path from node a to node b
        阅读全文
                
摘要:Problem DescriptionZero and One are good friends who always have fun with each other. This time, they decide to do something on a tree which is a kind of graph that there is only one path from node to node. First, Zero will give One an tree and every node in this tree has a value. Then, Zero will as
        阅读全文
                
摘要:Problem DescriptionPfctgeorge is totally a tall rich and handsome guy. He plans to build a huge water transmission network that covers the whole south...
        阅读全文
                
摘要:The traffic network in a country consists of N cities (labeled with integers from 1 to N) and N-1 roads connectingthe cities. There is a unique path between each pair of different cities, and we know the exact length of each road.Write a program that will, for each of the K given pairs of cities, fi
        阅读全文
                
摘要:Problem DescriptionMex is a function on a set of integers, which is universally used for impartial game theorem. For a non-negative integer set S, mex...
        阅读全文
                
摘要:DescriptionThis year, there have been many problems with population calculations, since in some cities, there are many emigrants, or the population gr...
        阅读全文
                
摘要:DescriptionPlain of despair was once an ancient battlefield where those brave spirits had rested in peace for thousands of years. Actually no one dare step into this sacred land until the rumor that “there is a huge gold mine underneath the plain” started to spread.Recently an accident destroyed the
        阅读全文
                
摘要: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 dogs. At lunchtime, the dogs will stand on one line, numbered from 1 to n, the leftmost one is 1, the s
        阅读全文
                
摘要:DescriptionThe citizens of Bytetown, AB, could not stand that the candidates in the mayoral election campaign have been placing their electoral posters at all places at their whim. The city council has finally decided to build an electoral wall for placing the posters and introduce the following rul
        阅读全文
                
摘要:DescriptionN (2 2 #include 3 #include 4 #include 5 using namespace std; 6 7 const int MAXN = 8010; 8 9 int key[MAXN], weight[MAXN], child[MAXN][...
        阅读全文
                
摘要:DescriptionThe police office in Tadu City decides to say ends to the chaos, as launch actions to root up the TWO gangs in the city, Gang Dragon and Gang Snake. However, the police first needs to identify which gang a criminal belongs to. The present question is, given two criminals; do they belong t
        阅读全文
                
摘要:DescriptionLet N be the set of all natural numbers {0 , 1 , 2 , . . . }, and R be the set of all real numbers. wi, hi for i = 1 . . . n are some elements in N, and w0 = 0. Define set B = { | x, y ∈ R and there exists an index i > 0 such that 0 | x, y ∈ R and x0 2 #include 3 #include 4 #include ..
        阅读全文
                
摘要:一、平衡树1、treap树 1 int key[MAXN], weight[MAXN], child[MAXN][2], size[MAXN]; 2 int stk[MAXN], top, poi_cnt;//not use point 3 4 inline int newNode(int k) ...
        阅读全文
                
摘要:DescriptionTed has a new house with a huge window. In this big summer, Ted decides to decorate the window with some posters to prevent the glare outside. All things that Ted can find are rectangle posters.However, Ted is such a picky guy that in every poster he finds something ugly. So before he pas
        阅读全文
                
摘要:一、代码: 1、求逆元(原理貌似就是拓展欧几里得,要求MOD是素数): 2、底层优化(正确性未验证): 3、扩栈,这玩意儿在OJ上用能防爆? 4、神速读入fread 二、神牛blog matrix67 ZKW watashi 三、专题 动态规划系列: 数位dp模板 字符串系列: 【专辑】AC自动机 
        阅读全文
                
 
                    
                     
                    
                 
                    
                
 
         浙公网安备 33010602011771号
浙公网安备 33010602011771号