Ural_1033
Note that the next two entrance may not be connected, and you can use the DFS count.
# Include # Include String . H> # Define Maxd 40 Int N, G [maxd] [maxd], vis [maxd] [maxd]; Char B [maxd]; Int DX [] = {- 1 , 1 ,0 , 0 }, Dy [] =
Zoj_3229
The source sink has the largest stream problem in the upper and lower circles. For details, refer to this blog:Http://blog.csdn.net/water_glass/article/details/6823741, I feel like you can do it in the same way. Note that you do not need
Hdu_3605
The reason why I wrote this question was that I accidentally saw using Hungary.AlgorithmAfter completing the multi-match of a bipartite graph, we found that the Hungarian algorithm was expanded based on the original maximization matching
Poj_2391
This question involves the issue of time control, but time is difficult to control. Another idea is to find out whether the actual length of time reflects the possibility of reaching another point from one point, therefore, we may want to
Spoj_962
To ensure that each vertex passes through only one time, you can split vertex I into I and I ', and connect an I-> I' with a capacity of 1.
When adding edge x Y, connect to y '-> X and X'-> Y, and then connect s to 2', 1 ', and 3' t,
Sgu_194
For the upstream and downstream feasible stream problems with no source sink, see http://blog.csdn.net/water_glass/article/details/6823741.
# Include # Include String . H> # Include # Define Maxd 210 # Define Maxm 240010 # Define INF
Spoj_1716
This topic is similar to spoj_1043's gss1, but it only adds the single-point modification function. Use the line segment tree to implement the corresponding functions.
# Include # Include String . H> # Define Maxd 50010 # Define INF
Zoj_2676
This question can be done using the 0-1 score plan like the optimal rate Spanning Tree, except that the optimal rate spanning tree requires a minimum cut every time.
For each bipartite graph, an edge with the negative weight may appear
Poj_2455
Each route can be guaranteed only once through the network stream, and the longest side can be minimized through the bipartite enumeration.
# Include # Include String . H> # Include # Define Maxd 210 # Define Maxm 80010 # Define INF
Ural_1027
You can mark several statuses with integers and scan the text characters one by one. If some conditions are met in the current status, the system will jump to the next status, if you jump into an invalid state, you can directly break it,
Spoj_1873
The sub-problem of this question is actually sgu_114 class question (http://www.cnblogs.com/staginner/archive/2012/01/11/2319989.html ).
First, you can change the meaning to moving one or more blocks together to the left or the right
Poj_1273
For the basic topic of the largest stream, you can directly solve the maximum stream from S to t after creating the graph.
# Include # Include String . H> # Include # Define Maxd 210 # Define Maxm 410 # Define INF 0x3f3f3f Int N, m,
Ural_1032
Unlike some people on the Internet, this question does not need to select consecutive numbers because of translation problems. It can prove that this question must be resolved, it can be proved that there must be a continuous number of
Ural_1031
The DP equation is well written, but if we use a bare O (N ^ 2) it should time out (but some people say that O (N ^ 2) can also pass through when turning over the problem-solving Report), so we need to optimize the DP process.
Since
Spoj_2916
This topic needs to be discussed in different situations. If Y1 = x2, you can discuss and update the optimal solution one by one based on the location.
After analysis, we can find that you can write two query functions based on the
Spoj_2713
The query interval and the line segment tree are easy to implement, while the opening operation cannot be implemented by the method of passing down the lazy mark at first glance, but think about it carefully, in fact, the maximum number
Ural_1048
High-Precision addition.
# Include # Include String . H> # Define Maxd 1000010 Int A [maxd], N; Void Solve (){ Int I, X, Y, S, C; For (I = 0 ; I ) {Scanf ( " % D " , & X ,& Y); A [I] = X + Y;} c = 0 ; For (I = N- 1 ; I> = 0
POJ_3281
The difference with general matching is that this question requires both cows and two things to be bound at the same time. The idea behind the previous matching problem is to concatenate cows, food, and drinks, however, if a cow is
HIT_2543
There are two types of fees for each edge. One is 0, the other is c2, and the corresponding capacity is c1, the capacity corresponding to the cost of c2 is inf. Since an edge has the attribute of two edges, it is better to simply split it
JOJ_2453
If the last few sugar values are 1, it doesn't matter who the sugar is. Therefore, we may consider how to distribute the sugar with the final value of 2 first, in this way, only the sugar with the value of 1 can be allocated as needed, that
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