2019.10.19 examination report

Nap examination, white waste of a problem, to be honest this is a really good question, suggesting that people think the topic of a clear direction, violent score-friendly, examine the very basic knowledge

A. Bell number

label:

CRT + matrix fast power

answer:

Quite the topic and people of conscience, to the two most important equation, considering the number of mod decomposition, each made out of prime CRT,

Due to the large n, so use matrix multiplication optimization, attention B [p * 2-1] are two transfer

B. crossing the square

The examination room $ O (n ^ 4) $ violent past 20w group to beat, but n, m read anti-explosion that led to regret zero, a reference to an yh words:

I did not think you are so rigid thinking

But after my strong (feng) Lie (kuang) contingent (chui) responsibility (da) he has not said so

label:

AC automaton + Dp

answer:

50 min Dp define f [i] [j] [k] [L] i represents an 'R', j a 'D', s [0] matches the k bits, s [1] matches a L-bit program number, KMP array Dp to pretreatment nxt

It focuses on how to optimize this Dp:

Consider for s [0] and s [1] to build an AC automaton,

After setting dp [i] [j] [k] [0/1/2/3] represents a group selected the i-th, j th 'R', and now node k on the AC automaton, the last dimension is matched condition

Such complexity becomes $ O (n ^ 3) $ a

C. dance night

label:

The maximum flow + Tarjan

answer:

First, find a group with a maximum Dinic match, after construction of a new map:

(Direct reference solution to a problem describes too much trouble)

Matching edge (i, j) j to i even side
non-matching edge (i, j) i to j even edge
matching left point i (i, S)
does not match the left point i (S, i)
matches the right point j (T, j)
does not match the right point j (j, T)

After Tarjan point reduction, for each non-matching edge, the two endpoints within the SCC is not a side that is not legitimate, simple to prove it:

This is provided as a non-matching edges (i, j), vis [i] i represents the match, obviously when vis [i] & vis [j] == 0 when SCC is a certain method,

In the case of vis [i] == vis [j] == 1, we can find the same algorithm as Hungary (may not) have a wide road, into the above-mentioned problems

Guess you like

Origin www.cnblogs.com/AthosD/p/11709169.html