Luogu: P1653 Monkey (tree / graph storage + reverse thinking edge deletion -- > edge addition)

Rogue: Monkey A very disgusting question. The meaning of the question cards you first, making you feel that it gives the structure of a tree (one monkey with two hands) But in reverse, the monkey's hand is a directed edge, and there are double edges or self rings in the graph A monkey's hand is not holding the other monkey's hand (release ...

Posted by pazzy on Wed, 05 Jan 2022 18:53:09 +0100

Algorithm learning notes: differential constraints

Differential constraint Problem type description given n n n variables and m m m constraints, e.g x ...

Posted by one on Mon, 03 Jan 2022 07:39:58 +0100

[algorithm design and analysis] solving athlete matching problem by backtracking method (curriculum design)

Solving athletes' matching problem by backtracking method abstract Aiming at the problem of the best matching of athletes, this paper uses the backtracking method to find the optimal solution of competition advantage score, and studies the best matching method of male and female athletes, so as to maximize the sum of competition advantages of ...

Posted by mrdance on Mon, 03 Jan 2022 06:41:31 +0100

Topological sorting of hand-in-hand Teaching

Topological sorting of hand-in-hand Teaching In graph theory, * * Topological Sorting Is a linear sequence of all vertices of a directed acyclic graph (DAG) * *. And the sequence must meet the following two conditions: Each vertex appears only once.If there is A path from vertex A to vertex B, vertex A appears in front of vertex B in the ...

Posted by BLaZuRE on Thu, 30 Dec 2021 00:30:49 +0100

[ACWing] 4228. Eight digital II

Title address: https://www.acwing.com/problem/content/description/4231/ In a 3 × 3 3×3 three × In the grid of 3, 1 ∼ 8 ...

Posted by sandingmachine on Wed, 29 Dec 2021 00:43:46 +0100

Depth first traversal of Graphs

Depth First Search (DFS) is one of the most common graph searches. Depth First Search continues along a path and returns to the node just accessed when it is unable to search. The feature of depth first is that for the later accessed node, its lead node is accessed first. According to the characteristics of depth first traversal: latecomers ser ...

Posted by The1PatO on Sat, 25 Dec 2021 15:10:54 +0100

Network flow - bipartite graph matching - pilot pairing scheme problem - network flow question 24 - Luogu P2756

Network flow - bipartite graph matching - pilot pairing scheme problem - network flow question 24 - Luogu P2756 Title Description There are n pilots in total, including M foreign pilots and (n - m) British pilots. Foreign pilots are numbered from 1 to m and British pilots are numbered from m + 1 to n. For a given cooperation between foreign p ...

Posted by daven on Fri, 24 Dec 2021 17:14:17 +0100

PTA 7-35 inter city emergency rescue (25 points (s))

As the head of a city's emergency rescue team, you have a special national map. The map shows multiple scattered cities and some expressways connecting cities. The number of rescue teams in each city and the length of each expressway connecting the two cities are marked on the map. When other cities have emergency calls for you, your task is to ...

Posted by exa_bit on Fri, 24 Dec 2021 01:22:47 +0100

Cut points and bridges of undirected graphs

Given undirected connected graph: For one thing u u u. If deleted from the figure u u u and all u ...

Posted by d99kg on Thu, 23 Dec 2021 09:11:15 +0100

Strongly connected components of directed graphs

B3609 [graph theory and algebraic structure 701] strongly connected components Some concepts: If any two nodes in a directed graph x , y x,y x. Y, existence ...

Posted by Cenron on Thu, 23 Dec 2021 06:37:00 +0100