2-SAT problem set -ybtoj
The so-called 2-SAT problem is that there are two SAT problems (errors)
SAT is the abbreviation of well posedness problem. The general form is k - well posedness problem, which is abbreviated as k-SAT. And when
k
>
2
...
Posted by riwan on Thu, 24 Feb 2022 03:57:36 +0100
[Luogu] P1608 path statistics
Title address:
https://www.luogu.com.cn/problem/P1608
Title Description: The staff quality of "RP restaurant" is not general. After calculating the same phone number, they are ready to let HZH and TZY deliver fast food. They draw a map of the city they live in. It is known that on their map, there are
...
Posted by gio2k on Sun, 20 Feb 2022 05:44:27 +0100
[GDOI2013] explanation of letter connection
Problem surface
There is a game in which a lattice of m rows and n columns is given on the plane. There are obstacles on some grids, and there may be English letters on grids without obstacles. Now it is required to establish a path on the empty grid, so that there is a letter at both ends of each path, and the letters at both ends are differe ...
Posted by paparanch on Sat, 19 Feb 2022 10:34:11 +0100
Shu Chuan's going to the meeting alone
Problem surface
Description
[title background] In 215 ad, Liu Bei took Yizhou, and Sun Quan ordered Zhuge Jin to ask Liu Bei for Jingzhou. Liu Bei refused, and Sun Quan was so angry that he sent LV Meng to lead the army to take Changsha, Lingling and Guiyang. Changsha, Guiyang and Shu will surrender immediately. After learning that, Liu B ...
Posted by Bladescope on Fri, 18 Feb 2022 21:46:05 +0100
Depth first traversal of numbers and graphs & breadth first traversal of trees and graphs
Depth first traversal of trees and graphs & breadth first traversal of trees and graphs
The two traversal methods of tree and graph are algorithms based on the idea of dfs and bfs. Its idea is still recursive, but the traversal object becomes an undirected graph, so there are more precautions in the process of graph construction and sea ...
Posted by Dia:NL on Mon, 14 Feb 2022 11:56:29 +0100
[nearest public ancestor] [biggest bottleneck tree] car 51Nod3061
Planet A has n cities, numbered from 1 to N, with m two-way roads between them. Each road has A weight limit for vehicles, referred to as weight limit. Now there are q trucks transporting goods. Xiao Ming wants to know the maximum load of each truck under the condition of not exceeding the vehicle weight limit.
Input
Two integers n,m in the f ...
Posted by littledragon on Mon, 14 Feb 2022 07:40:23 +0100
Minimum spanning tree algorithm and bipartite graph algorithm
There are two minimum spanning tree algorithms. One is prim algorithm and the other is Kruskal algorithm. The time complexity of the two algorithms are o (n^2) and O (mlogn) [n is the number of points and m is the number of edges]. The two algorithms behave differently in different graphs.
Let's start with prim algorithm.
The core idea of thi ...
Posted by FaT3oYCG on Sun, 13 Feb 2022 11:57:46 +0100
Python group of the 11th Blue Bridge Cup provincial competition in 2020 (real topic + analysis + code): Crop hybridization
1 true question
Title Description
Crop hybridization is an important step in crop cultivation. There are known n crops (No. 1 to n), and the time from sowing to maturity of the ith crop is Ti. Crops can be hybridized in pairs, and the longer of the two kinds of time is taken as the hybridization time. If the planting time of crop A is 5 ...
Posted by curmudgeon42 on Fri, 11 Feb 2022 11:59:35 +0100
[ACWing]2277. Secret milking machine
Title address:
https://www.acwing.com/problem/content/2279/
Farmer John is making a new milking machine and hopes to keep it strictly confidential. He hid the milking machine deep in the farm, enabling him to carry out the task without being found. In the process of machine manufacturing, he has to carry out a total between the cowshed and th ...
Posted by scottd on Fri, 11 Feb 2022 06:58:08 +0100
[algorithm problem inductive collection] graph theory - difference constraint
The application explanation of differential constraint can jump to: Principle and application of differential constraint algorithm
1, AcWing 1169 candy
[Title Description] In kindergarten
N
N
N children. Now the teacher wants to distribute candy to these children ...
Posted by Ell20 on Fri, 11 Feb 2022 05:47:05 +0100