Provincial election simulation game of a topic map 3.29

LINK: Fig.

Spanning forest is obtained in a tree or ring of FIG. + Spanning each program contribution and forests. n <= 16, m <= (n-1) * n / 2.

FIG contribution of only one ring in a program for each occurrence of a maximum block size of this product Unicom FIG.

(Blast search could get a lot of points since the upper bound is not critical search is similar to a 2 ^ m C (m, n) + C (m, n-1) + C (m, n-2) + ... complex degree.

Since at most n edges and at most only one ring in FIG. However, since the number of edges shaped pressure point considered excessive.

When seeking spanning tree forest is not difficult to think of f [i] represents the number of collection points spanning i.

For a collection i ran matrix tree theorem of violence for violence last merged find it difficult to merge as the program and answer different states have different answers but the program can be combined with the corresponding answer is difficult merged.

A trick: building a virtual source point 0 so that the number of spanning trees source even this last side is equivalent to a graph for each link we require the block size to the sum of the product of each point.

It can be understood: 0 Connection with a few blocks of each Unicom Unicom blocks and their associated programs 0 points and internal spanning tree is their own programs.

All programs just equal to the product of the sum and just.

Obviously correctness.

Consider the figure there is a ring how to do? The number of spanning at least one side of a map of + this is extremely difficult to solve the problem of the need to matroid something.

Consider first enumeration ring + at some point it may become that the above situation.

The banding point! Then it becomes the case of the above chain spanning tree of the forest still do that.

How to get the ring? No set to a determined point of view of the number of rings considered dp i may run a plurality of ring starting with the smallest number that we define the point as the starting point to violent run-shaped pressure dp.

Since the pros and cons of a ring can run twice so be divided by two.

Considering become the spanning tree forest seeking answers to how the contribution of each block of the answer Unicom unchanged. Multiplied by the outer ring to a program.

Guess you like

Origin www.cnblogs.com/chdy/p/12595952.html