Uva_125
Because the number of path entries in a-> B is equal to the sum of the product of the number of path entries in a-> I and I-> B, therefore, in the process of using Floyd, we can calculate the number of path lines between A and B. If a-> B
Hdu_1565
There was no idea at the beginning, and later I came to the others' solution report saying that we should construct a bipartite graph and convert it into a minimal cut.
Later, I thought about it again. The general principle is as
Uva_104
In fact, this question is to find a minimum ring with the product of exchange rate greater than or equal to 1.01. Because the data volume is small, we can use the dynamic regulation + Floyd to solve the problem. Let's set f [I] [J] [k] to
Hdu_1569
There was no idea at the beginning, and later I came to the others' solution report saying that we should construct a bipartite graph and convert it into a minimal cut.
Later, I thought about it again. The general principle is as
Uva_658
This problem has been entangled for a long time. Later, when I made another question, I was told that it is generally faster to use binary to represent the State, in this way, a row can be represented by a number. Continue to think about
Uva_12299
This is the question of Hunan Provincial competition. If I could have learned ytq and gave me a PPT later, it would have been too late.
This topic has a shift operation more than the ordinary rmq, store the line segment tree with heap,
Poj_1753
After several days, we have already written this question 3rd Times. After being familiar with bit operations, we have solved this problem more efficiently.
At the same time, this question also has a little skill in enumeration. If we
UVA_10057
First, sort the sequence in ascending order. If N is an odd number, A can only be the number in the middle. If N is an even number, then A can be any integer in the interval composed of two numbers.
#include#include#includeint
HDU_2066
Directly use the Bellman-Ford algorithm optimized by the queue to find the shortest path of each vertex, and then find the minimum value of the shortest path of each desired location.
#include#includeint q[1010],inq[1010];int G[1010][1010],
HDU_2544
Use the Bellman-Ford Algorithm Optimized in the queue to obtain the shortest path of each point.
#include#includeint N,M,G[110][110],d[110];int q[110],inq[110];int init(){int i,A,B,C; scanf("%d%d",&N,&M);if(!N&&!M)return 0; memset(G,0
POJ_2723
At the beginning, I still didn't grasp the core of the 2-SAT question and won't make a diagram.
In fact, the most important thing about 2-SAT is to find out the relationship between 0 and 1, that is, whether a thing is selected or not, or
HDU_1426
This question seems to be available for deep search, but I actually chose this simple question in the sudoku just to practice the Dancing Links. The basic idea of Dancing Links is to convert the graph into a 0-1 matrix and finally convert
POJ_3683
This is a 2-SAT problem. In fact, algorithms and diagrams are not difficult to think about, but the encoding complexity is relatively high.
In the composition, we need to determine whether the two segments are intersecting. the easier way
UVA_12299
First, analyze the simple situation. The number indicates the maximum heap. 2 wins, 3 loses, and 4 wins ,...... In fact, it is clear that even numbers must win, but odd numbers cannot be said, so let's look at it from another angle.
If 3
POJ_3468 (1)
After digesting the ideas on the PPT, I made a new question.
Remember the elements of the original array as a [I], and then we use the heap to create two line segment trees, the original array of a tree is x [I] (x [I] = a [I]-a [I-1],
UVA_10273
Because of the classification of graph theory, I did not dare to write violence at first. Later I found that the problem solution was basically violent, and I wrote it with brute force.
The enumerated cycle is the minimum public multiple
Uva_000086
A bare short-circuit problem can be solved directly by using the Bellman-Ford optimized queue.
#include#include#define MAXD 20010#define MAXM 100010#define INF 1000000000int N, M, S, T, q[MAXD], inq[MAXD];int first[MAXD], next[MAXM],
UVA_563
We can introduce a source point to be connected to a robbery point, introduce a sink point to be connected to the escaped point, and then check whether the maximum flow is equal to the number of robbery points.
Because the capacity of each
HDU_4081
The general idea of this question is like this. First, find a minimum spanning tree, then find or by the way, find the maximum edge weight on the path between any two points on the Minimum Spanning Tree, and then enumerate magic road,
POJ_2182
I did not expect that the line segment tree could be used in this way. It is true that the line segment tree is too flexible ......
This question can be converted into querying from the back to the front. For example, there are x cows whose
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service