"Summary" polynomial generating function example (2)

It is \ (FWT \) in the example.
Here I do not much problem, the coach said much talk as much as possible.
I can only tell you all done up.

1. bitwise or
http://hzoj.com/contest/126/problem/13
explanations sent directly Chain: https://www.cnblogs.com/Lrefrain/p/11655078.html

2. Random Walk
http://hzoj.com/contest/220/problem/5
explanations sent directly link: https://www.cnblogs.com/Lrefrain/p/11655078.html

3. The missing answer
http://hzoj.com/contest/126/problem/12

This question is not easy. (If you want to learn \ (skyh \) direct partition can be, where they talk about \ (FWT \) method)
First, this thing can be found only eighty-nine prime factors, and we \ (gcd \) is a prime factor power take \ (min \) , \ (LCM \) is taken \ (max \) .
Consider violent seizure of all the qualifying number, that is, to meet the \ (gcd | x, x | lcm, x <n \) of all \ (the X-\) .
This number is not much, the line will sift the discovery of more than 700 large.
Pressure considerations like all prime factors of the two states indicating whether the \ (GCD \) a \ (min \) , and \ (LCM \) a \ (max \) .
One by one \ (dp \) each number.
So we both positive and negative twice \ (dp \) .
Get \ (sum \) and \ (suf \) two arrays.
And consider our answer is kind of how.
It requires both a prefix and suffix or take up a collection and get the current number up or get complete works.
Do for each prefix or suffix a convolution, but found that this can not \ (O (1) \) to answer questions, we ask for collection must be replenished this number a superset, that is to say do it again \ ( AND_FWT \) can be.
Such complexity is right, but often get caught.
As do four \ (FWT \) .
Consider inclusion and exclusion.
In fact, in some cases the problem into a set or as complete works, require a certain set of programs must be selected.
After a first condition removed.
Irrespective of whether a collection is selected, the program required a subset of the set appears.
First \ (FWT \) out there are a few numbers is a subset of the current collection, set to \ (CNT_S \) .
This program is \ (2 ^ {cnt_s} \
) Now consider how to force a collection is selected.
Program superset of all this set current becomes \ (2 ^ {cnt_s-1 } \) is equivalent to the force currently selected.
Then look at the number of values in the collection must not occur, the use of this number is the number to inclusion and exclusion.
If using the binomial inversion here to understand, in fact, most in the form of inversion.
That factor is \ ((- 1) ^ { mx-s} \) is the equivalent is \ ((- 1) ^ { ni} \)
The sample is only needed once \ (FWT \) can be.

Guess you like

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