"Summary" Selection of miscellaneous questions

Bitwise Xor
we can find the minimum value of the exclusive OR is a sequence number of two neighboring size \ (XOR \) take \ (min \) .
So we sort of sequence.
Need only count adjacent \ (XOR \) is greater than or equal \ (K \) scheme.
\ (dp [i] \) is \ (I \) ending minimum \ (XOR \) is greater than \ (K \) scheme.
Then we can carry out his array similar to a tree with a lift up to the transfer.
The use \ (trie \) to transfer.

MOD Problem
flood problem

\[\begin{aligned} ans&=\sum\limits_{i=1}^{n}n\ mod\ I\\ &=\sum\limits_{i=1}^{n}n-i\lfloor\frac{n}{i}\rfloor\\ &=n^2-\sum\limits_{i=1}^{n}i\sum\limits_{j|i}^{n}I\\ &=n^2-\sum\limits_{j=1}^{n}\sum\limits_{i|j}i\\ &=n^2-\sum\limits_{j=1}^{n}\sigma(i)\\ \end{aligned} \]

Then wire sieve.

Square string
\ (dy \) talked of the original title.
Looks like yes. .
Method or use interpolation point, enumerated length \ (len \) , each \ (len \) th interpolation point.
We found every two strings must be inserted over the two points.
Then to find two points \ (lcp \) and \ (lcs \) on it.
Such can be determined after about two adjacent particular points to the square of the string endpoints range.
Then a similar \ (hash \) approach to statistical answer on the line.

Conjugate
League original title bar.
Considered separately for each pile and pile contribute.
Make a bunch to contribute at the pile before, it can be found at this time other heap is invalid.
Then the final answer is:

\[ans=1+\sum\limits_{i=2}^{n}\frac{a_i}{a_1+a_i} \]

The Lakers
still feel the original title.
I can not remember where to see the.
Do not consider each non-point end of his own expectations.
Then the answer is:

\[ans=\sum\limits_{i=1}^{n}\frac{1}{d(i)} \]

It can be a \ (min \ _25 \) sieve do.
Although I did not want to know how to do.

Game with Marbles
to obtain the desired number of touch green touch the ball before a basketball.
If you touch the red membrane it can be thrown away again, so think red ball is actually non-existent.
Then there are:

\[E=\frac{G}{B+G}(E+1) \]

and so:

\[E=\frac{G}{B} \]

Corresponding to a basketball so much green ball, that the ball is the total green \ (\ frac {KG} { B} \) th slightly.
Red recalculated separately.
It can be calculated for each red ball. If the ball did not, has not been touched, the probability is \ (\ frac {B} {
B + 1} \) so that the contribution of a ball \ (1- \ left (\ frac {B} {B + 1} \ right) ^ K \)

Game
This is a Bayesian formula.
We put every point left and right ends as determined at this point depends on the desired standard.
With tree line and two matrices to maintain these intervals.
Matrix for each point of maintenance and Bayesian formula to draw denominator.

AGC035D
found to actually eliminate a number to add on both sides.
Then each weight must be multiplied by a factor up.
Be the interval \ (dp \) .
Set \ (dp [l] [r ] [x] [y] \) represents done right endpoint coefficient of \ (X, Y \) , the interval \ ([l + 1, r -1] \) has been eliminated the minimum answer.
Enumeration mid-point consolidation range.

\[dp[l][r][x][y]=\min\limits_{mid=l}^{r}dp[l][mid][x][x+y]+dp[mid][r][x+y][y]-(x+y)A_{mid} \]

operation
leagues original title.
Since division by two would not carry out many times.
So we can focus light directly on the degree of division.

Probability
heard, wrote in a generation functions inside.
https://www.cnblogs.com/Lrefrain/p/12274363.html
the last of this.

Jiry Matchings
classical methods
How \ (FFT \) quickly find all contributions under the division of the heavy chain.
In fact, from the leaves of all light partition son \ (FFT \) , and then re-partition from a heavy chain \ (FFT \) , the contribution of a heavy chain of partition \ (FFT \) out.
This time become the top light chain sons of others, then this operation can be recursive.

Little Star
did title.
https://www.cnblogs.com/Lrefrain/p/11644600.html
subset of the inversion thing.

Ribbons on Tree
consider the inclusion-exclusion.
If we remove some of the edge set, it is equivalent to a block division communication, while selecting a representative point of the program from the communication block.
This is \ (prufer \) concluded sequences, as detailed in the number of trees that question
this thing if the problem solution method used to write too much trouble.
We can squeeze out a second dimension directly
provided directly \ (dp [x] [0/1 ] \) represents the \ (X \) subtree of point (X \) \ where communication block representative point whether there the number of programs.

Guess you like

Origin www.cnblogs.com/Lrefrain/p/12656405.html