Analog Test 69

T1:

  Spacing is difficult to find two $ $ n-multiple of, the number of pieces of the discharge must be the same.

  DP can be resolved with a backpack, set $ dp [i] [j] $ $ in consideration of the column I $, $ J $ put a number of pieces of the program.

  DP range can not exceed $ n $, but with the above properties.

  Placed in each column are independent, so you can use fast power obtained.

  State transition equation:

    $dp[i][j]=\sum \limits_{k=0}^{min(j,n)} dp[i-1][j-k]*s[i][k]$

    $s[i][j]=(C_n^j)^{\large \frac{n-1}{i}+1}$

  Time complexity $ O (n ^ 4) $.

T2:

  For all points, the position of the left end point of a certain legal leftmost number is greater than its right in.

  Maintains a monotonically decreasing monotone stack, each point corresponding to the left can be transferred from point flicked from the elements.

  Provided that the corresponding elements flicked left end point is smaller than the value of the current point is left, or not legal.

  Time complexity $ O (n) $.

T3:

  No way to directly maintain, can only Mo team.

  Mo ordinary team needs to maintain the longest continuous range segment with segment tree, time out.

  So this question to use rollback Mo team.

  Ask for each block, a right end point strictly monotonic, rollback is not required.

  The point left to go back, need to record the state of the stack.

  The answer may be a similar idea to update the list, the answer can only record both sides of the communication section.

  Time complexity $ O (n \ sqrt {n}) $.

Guess you like

Origin www.cnblogs.com/hz-Rockstar/p/11670063.html