2020-2-21 (DEF) solution to a problem by Yang Yi Chen and Ma Hongru

yyc:

D:
discussion, if n is even, a last start playback from X, a place a spacer, into the header from the re-release, for example. 4 = n:
....
... X-
.XX
.XXX
XXXX
If n is an odd and now finally put a X, and even as discussed in front of, for example, 5 = the n-
..... (special judge here)
.... the X-
... XX
.X.XX
.XXXX
XXXXX

E:

Convenience, let m = n root
input array of w.
Offline processing.
First data classification, the inquiry can be violent b> = m, and each query time complexity of O (square root of n)
asking for b <m, and to open a set of vector b is assigned to the same category.
Then enumerate all, b, represents an additional opening array p, where p [i] represents the (i, b) answer to the inquiry
is not difficult to find, for the same, b, there are p [i] = w [i ] + p [ i + b]
processing to output an answer, since b <m, so this part of the total time complexity O (n root of n)
a final time complexity of O (n root n)

 

 

mhr:

D (if else): X is greater than the first two cases equal to or less than half the half
case: X <= half:
See n parity, if n is even then the method of storing the last affirmative .X remaining prefix so we found an even number. the law can be found to do so no extra points behind to make up the numbers so a direct output ... XX like to
if n is odd so sure .X prefix is odd to find the law can be found in the prefix. prefix is an even number. number / 2 so that the penultimate to the front so that the output to the even hash ..... X.XX form.
case: X-> half:
this is the case has no distinction between what is behind the fill .X suffix X, only need to know the total number of suffix X then you can put in front with .X example 74 is .XXXX
Why .X is the best of it, because no matter how personal the second rotating cylinder chamber of a gun as long as the first person to second person must die dead
prefix number to see how the law? The same parity are the same people go through, all the people to experience the first X end
for rotation of the cartridge chamber .X. == ..X so sure because of the shift output ..X

Guess you like

Origin www.cnblogs.com/QLU-ACM/p/12343230.html