Solution to the problem of roads roads in Luogu sp338

thinking The adjacency table of dfs is composed of two parts: header node and table node. The header node stores each vertex of the graph, and the table node stores the adjacent vertex (that is, the edge of the graph) of the corresponding vertex of the header node with a one-way linked list. In the directed graph, it indicates that the header ...

Posted by Yaak on Thu, 17 Oct 2019 11:11:03 -0700

Solutions for high concurrency scenarios like seckill

Atomic transaction operation of redis <?php $http = new swoole_http_server("0.0.0.0", 9509); // Monitor 9509 $http->set(array( 'reactor_num' => 2, //reactor thread num 'worker_num' => 4 //worker process num )); $http->on('request', function (swoole_http_request $request, swoole_http_re ...

Posted by chu70077 on Thu, 17 Oct 2019 08:53:18 -0700

Word recitation [CodeVS3013] hash

Problem description Reimu has n words she wants to memorize, but she wants to remember them through a passage in an article. The article is composed of m words. She wants to find a continuous paragraph in the article, which contains the most words she wants to memorize (only one repeated one). And in the case of reciting as many words as po ...

Posted by lunarul on Wed, 16 Oct 2019 14:39:06 -0700

Transaction management in ORACLE

Because of the work requirements, a large amount of data needs to be inserted into ORACLE data, and then the manual management of transaction opening is selected to insert a large amount of data. However, a pit is encountered here. Before the transaction management of mysql was opened to insert data, copying mysql is a bit impractical. Only 299 ...

Posted by philvia on Wed, 16 Oct 2019 14:35:28 -0700

A collection of various derivations

A collection of various derivations   Derivation formula We've learned the simplest list derivation and generator expressions before. But in addition, there are dictionary derivation, set derivation and so on. The following is a detailed derivation format with list derivation as an example, which is also applicable to othe ...

Posted by jiggens on Wed, 16 Oct 2019 12:59:42 -0700

hdu6601 Keen On Everything But Triangle

Keen On Everything But Triangle Title gate Solving problems Use the chairman tree to find the k-small interval, first find the maximum value in the interval, then find the second and third... Until three consecutive numbers are found to form a triangle. Because for a group of numbers, if they can't form a triangle, the Fibonacci series is small ...

Posted by ryanyoungsma on Wed, 16 Oct 2019 12:31:58 -0700

Multi correction 2 Longest Subarray line segment tree

Given n C k and sequence ai (1-n), find the longest interval length, so that the number of elements in the interval is 0 or > = k, and all numbers are in the range of 1-C.   Explanation: If the right endpoint is fixed, the feasible left endpoint subscript is two consecutive intervals for each element.For each element, add one feasible lef ...

Posted by m@tt on Wed, 16 Oct 2019 12:14:56 -0700

Building multi page application with vue-cli 3

Create a project Hello World vue create hello-worldcd hello-worldnpm run serve Create a new page directory in src directory and a new page in pages directory App.vue and main.js are useless and can be deleted. The file name corresponds to the page name.   index.js import Vue from 'vue' import App from './index.vue' Vue.config. ...

Posted by michibk on Wed, 16 Oct 2019 11:05:42 -0700

python - three features of object-oriented (inheritance, polymorphism, encapsulation)

I. succession. 1. Inheritance: save code, standardize code 2. The inherited class is called the parent class, the base class, and the inherited class is called the derived class and the child class. 3. Category: divided into new category and classic category. New class: classes that inherit the object class are called new classes. In Python ...

Posted by Ben5on on Tue, 15 Oct 2019 12:02:51 -0700

Add LZO compression support for Hadoop

The compression mode with lzo enabled is very useful for small-scale clusters. The compression ratio can be reduced to about 1 / 3 of the original log size. At the same time, the speed of decompression is faster. install Prepare jar package 1) Download lzo's jar project firsthttps://github.com/twitter/hadoop-lzo/archive/master.zip 2) the na ...

Posted by fastfingertips on Tue, 15 Oct 2019 10:36:22 -0700