Logue P4065 [JXOI2017] color (line segment tree)

meaning of the title Title Link Sol Line tree board problems can not be done, it is more and more vegetables.. According to the description of the topic, a legal interval is equivalent to that the color in the interval does not appear outside the interval. So we can count where the longest left endpoint is for each right endpoint. At first, we ...

Added by TheHyipSite on Sat, 07 Dec 2019 00:52:46 +0200

C pointer principle - AT&T assembly

The standard assembler of Linux platform is GAS, which is the background assembly tool relied on by GCC, and is usually included in binutils package,--gstabs tells the assembler to add a symbol table to the generated object code. First, we complete the assembly:as -gstabs -o hello.o hello.sThe target code generated by assembler must be process ...

Added by blogger3 on Fri, 06 Dec 2019 15:30:17 +0200

[C + +] embarrassment ability of 28 friends

The concept of friend What is friendship? Friend is a relationship in C + + Friendships occur between functions and classes or between classes The relationship of friends is single and cannot be transferred Usage of friends Declare friends in a class with the friend keyword A friend of a class can be another class or a concrete functio ...

Added by Jaspal on Fri, 06 Dec 2019 02:13:34 +0200

Luogu P3722 [AH2017/HNOI2017] shadow devil (line segment tree)

meaning of the title Title Link Sol Why don't you solve the problem. In general, it is not difficult to think of monotonic data structure when considering the contribution of maximum value For this problem, we can preprocess the first position larger than him on the left and the first position larger than him on the right Then \ ((l_i, r_i) \) ...

Added by rebecca on Thu, 05 Dec 2019 13:58:41 +0200

01 maze problem solving (bfs, connecting block)

subject https://www.luogu.org/problemnew/show/P1141 This solution is mainly for my personal problems and attention. Solving problems Let's start with the Unicom block For example, if a fish swims in a pond, then in the case of unlimited time, the small fish will swim across all positions of the pond, which has nothing to do with the starti ...

Added by webtuto on Thu, 05 Dec 2019 04:16:22 +0200

[BJOI2017] tree challenges

According to the general idea, select a point x as the center of divide and conquer, and splice x to start the path from each point of the subtree. For the influence of color at the interface of two segments (i.e. the edge connected by X, if not, set as edge 0: color is 0, length is 0, reaching the son of 0), the path weight, edge number of eac ...

Added by rotwyla98 on Wed, 04 Dec 2019 17:35:08 +0200

[luogu1486] [depressed teller]

Title Link thinking In fact, this problem is to modify the delete operation in the tree. I have a way of doing it. When deleting, if the number to be deleted is larger than the root of this subtree, then turn the root into the right child of the root, which is equivalent to deleting the entire left subtree and root node. Then you need to re mai ...

Added by suma237 on Wed, 04 Dec 2019 14:13:35 +0200

bzoj4514 digital pairing

thinking Think of the cost stream first. Split points for each point. Then consider how we can ensure that each point is used only once. If \ (i \) and \ (j \) meet the conditions. Then connect an edge from \ (i \) to \ (j \) and from \ (j \) to \ (i \). In this way, every time we expand, we can see that a certain edge has been expanded twice. ...

Added by Bigun on Tue, 03 Dec 2019 22:45:44 +0200

C + + hands teach you how to implement variable length arrays

01 implement custom variable length array type Suppose we want to implement an array that will be automatically expanded. What functions should we implement? First, from the implementation given by the main function below, we can see what functions we need to implement. int main() { MyArray a; // Initialized array is empty for(int i = ...

Added by mxl on Tue, 03 Dec 2019 02:38:46 +0200

C pointer principle (27) - Compilation Principle - syntax tree and its implementation 7

The following completes a simple calculator to calculate through the syntax tree, first defines the structure of a syntax tree, then writes a flex file to parse numbers or symbols, returns itself to symbols, returns numbers to numbers, and assigns a value to d of yylval, which refers to a joint type, and then completes the addition of nodes of ...

Added by mattennant on Mon, 02 Dec 2019 08:42:31 +0200