Qaq did not go to the subject of large field of view to feel very unhappy Qaq
And then got stuck with a very water problem.
The morning was almost over and somehow the power of his computer had dropped Qaq
Then there's no code, QAQ, but it's not much of a problem qaq
First question
First of all, we found this to be a bare, blocky list of exercises.
But when I think about it, I don't know how to write a block list.
YY for a moment feel the block within the maintenance of a linked list seems to be time complexity is also O (n*sqrt (n))
It's about one hours, the border of the list, what's the trouble with the discussion.
And beat the Qaq on the side.
The practice is this:
We consider setting S (i,k) to indicate the number of times that the value of the first I block K appears
It is not difficult to find that the spatial complexity is O (n*sqrt (n)), the preprocessing time Complexity O (n*sqrt (n))
It's not hard to think about it. Each modification affects only 2*SQRT (n) values for this preprocessing
We're going to brute force modifying the preprocessing array.
Considering the existence of incomplete blocks when querying, this time we need to violence against these blocks
If the balance tree is maintained, the time complexity will be multiple log
It is not difficult to find that every time a block is modified, it is only added to the element and the end of the block.
So for each block to maintain a single linked list, incomplete block violence refactoring can do O (n*sqrt (n))
Second question
It's obviously a problem to be messed up.
The first 50-point approach is obviously a direct use of the pigeon cage principle of violence 1->a
It is not difficult at this time to find that the growth of f (x) is extremely slow
I took such an approach during the exam
We notice that if the value of the interval [l,r] is very close to k*a
Then we can move the two endpoints constantly to make them approximate k*a
For this implementation I was using the simulated annealing
The enumeration k is probably from 1->10, then uses the digital DP to determine the right endpoint closest to K*a
After the simulated annealing each calculates the difference, if the =0 exits, the difference is smaller must accept the movement, otherwise the probability accepts the movement
There must be no problem in time, and correctness will not prove
Took two hours without error qaq
Third question
Qaq YJP lost Face
Once read the paper, some points still a bit of impression, some points when the exam pushed push also pushed out
First of all, the first point is output directly.
The second point we notice is that the length is 2^22, the conjecture is the multiplication structure, and it is not difficult to find that each multiplier takes the inverse
The third point we notice is that there will always be a paragraph equal to the previous paragraph, where the length is 3,5,8,13, and then the total lengths are F (33).
The 33rd of the Fibonacci sequence
The fourth point to see the length of the sequence is natural to think of the FFT, it turns out to be a convolution
But modulus is not OK, feel free to find a few points to calculate the answer after the CRT can solve the modulus
Modulus is 2^22*25+1
The fifth point is to see that it's a polynomial open root.
The sixth point is obviously a polynomial open square root.
The seventh point is a graph, and we find that there are only two types of output: 0 and a strange number
And then found that the question was only two points, guess is to judge the relationship between two points
Figure two points of the relationship is clearly judged not connected, and then found the Unicom output 0, otherwise output that strange number
The eighth point is a tree, we found that the output is a tree of Benquan, with Ctrl+f to find a few numbers can be found this thing
Then ask is also two points, conjecture is the Benquan information between two points
Either the minimum edge, or the maximum edge, the last discovery when the maximum edge right
The nineth point is a graph that shows that the output is also a Benquan on the graph, and then surprised to find that the odd number of the seventh point in the output
Inquiry is also two points, and then sentenced Unicom, found that the connectivity is this strange number
Considering the eighth point, it is not difficult to guess the minimum maximum edge of the two points of the nineth point output
And then make the smallest spanning tree.
The tenth point of direct output can be Qaq
6.18 Exam Summary