2019 summer training camp Day6 Jinhua Selection of miscellaneous questions

Autistic training Day6

Selection of miscellaneous questions

CF round 469 E

I found impossible to take a number twice as good as 1,1 1,2.

It is selected from a number of positive and negative found impossible, since 1, -1 inferior to 1, -2.

hihoCoder Challenge 29 D

Set \ (f (x) \) represents the last number is less than equal to \ (x \) answer, from left to right and added to the number of maintenance \ (f (x) \) .

Add \ (A \) when \ (f (x) \) to add \ (| xA | \) , and then the \ (f (x-1) \) take min.

Obviously \ (f (x) \) is a piecewise function, and the slope are consecutive integers.

So only we need to maintain the inflection point can know the function looks like. Every time is the addition of two inflection points, and delete a rightmost, with a heap maintain gone.

CS Academy #32 G

Set \ (f_ {i, j} \) represents put \ (I \) number and for the (J \) \ number of programs, each transfer is put all or a 1 plus one.

Consider each number \ (S \) times the contribution of the answer, the contribution is \ (\ sum_ {i = 1 } ^ {\ infty} [ the current number of at least the i-th embodiment] \) .

That something is found just \ (\ sum_. 1 = {I} ^ {\ infty F_ {} of Ki, n-IS-} \) , can then be directly summed.

So done ......

THUPC 2017 I L small game

???

There should be more beautiful than the teacher's practice ......

Star by Yang Jiaqi

First, this question is obviously a circular convolution modulus 998244353-1 have factor 17, so do not worry.

Set \ (f_s \) represents the \ (S \) numbers pick program, \ (G_S \) represents \ (S \) number of communication schemes. ( \ (G_0 = 0 \) )

Then there are \ (F = G ^ E, G = \ LN F \) . Wherein a subset convolution multiplication.

Consider a subset convolution process: recording \ (f_ {i, S} \) , if and only if \ (| S | = i \ ) when \ (f_ {i, S} \) has a value, then \ (f_i \) seen as an element, the element is defined multiplication or convolution, it is difficult to \ (f * g \) can be seen as a polynomial multiplication, just after the finish should take extra elements removed.

The \ (F_i \) do Möbius transformation, multiplication element is then multiplied by the corresponding position.

Then turn into two-dimensional \ (F '_ {S, I} \) , this time the enumeration \ (f'_S \) , really becomes polynomial multiplication, so \ (\ exp \) also It can be defined.

So \ (\ ln \) can also define it came out, so he finished.

SRM 702 Finding Friends

Dichotomous answer each point record \ (l_i, r_i \) indicates the point about the recent meet the conditions.

Then an interval \ ([L, R] \ ) valid if and only if each point has \ (l_i \ ge L \) or \ (r_i \ R & lt Le \) .

Then recorded \ (solve (L, R) \) represents \ ([L, R] \ ) whether there are satisfied condition range.

Swept from both sides to the middle, if the condition is not satisfied inevitably find points on both sides and then to recursively deleted.

Surprised to find that the complexity is right, it is done.

SRM 713 Coins Query

Note that a small volume, only the last can be referred to state 100, and matrix multiplication.

Note that the same transfer matrix, so \ (O (n ^ 3 \ log m) \) a.

VK Cup 2017 Round 3 F

Consider multiplier, provided \ (f_ {n, p} \) represents the \ ([1, n] \ ) inside the selected number, the maximum parity is \ (P \) generating functions.

Doubled shifted easily.

I always think of how multiplier

SRM 715 Pre In Post

Set \ (f_ {x, y, a, b,} \) represents a sequence \ ([A, A + I) \) , the second \ ([B, B + I) \) , traversal The method is \ (the X-, the y-\) , if possible.

If the traversal methods that same judgment whether direct all equal.

If not, then we can certainly know what the root yes.

If there is a preorder, then the child becomes a problem.

Otherwise, the enumeration demarcation point where.

Complexity somehow on the right? ?

Codechef SNCKEL17

Title equivalent to dynamically modify the right side, right side asked the maximum minimum spanning tree inside.

Can LCT + segment tree partition, \ (O (n-\ log ^ n-2) \) .

RC algorithm:

  1. Reduction. The modification involves side set to \ (\ infty \) , running a minimum spanning tree, wherein the side not certainly waste.
  2. Contraction. The modification involves the edge into an \ (- \ infty \) , ~~~, certainly inside edge which, directly shrink up.

Then both sides of the divide and conquer, the same can prove \ (O (the n-\ log ^ the n-2) \) , however, does not permit ......

THUPC 2017 D

First a random initial solution, then adjust.

Find a point of hanging up, tune into a color seems to be ok (but maybe a neighbor tone finish and hung up), with queues simulate this process.

Each time the same number of sides minus one ends color tone after completion, the complexity of the \ (O (m) \) .

Guess you like

Origin www.cnblogs.com/p-b-p-b/p/11305276.html