8.15 problem solution

T1

A math problem, understanding of the meaning of the questions on the test are some problems, I still have not carefully studied, so the pigeons

T2

Was first determine whether there is a legitimate program, if there is a legitimate program fell inquire title every $ x $, and push down the process somewhat like simulation, let's discuss how to determine whether there is a legitimate program, which used a DP you dare? $ skyh $ examination room AC, ye people think, we do not know, I do not dare to ask

Legal judgment

Provided $ dp [i] [j] $ denotes performed after the first $ $ I op, whether there may be 1, $ dp [i] [j] = 0 $ represents no solution, $ dp [i] [j] Representative = 1 $ solvable, then what we consider to $ dp [i-1] [j] $ can be transferred to the $ dp [i] [k] $ in, $ K $ what conditions need to meet

For $ and $ operation, our original result there have been a number $ j $, and the current can also be a $ a [i] $ one-number, the number that we get the maximum of $ { \ min} (a [i], j) $ th a, should have at least $ \ max (0, a [i] + jm) $ th a front half of a good understanding, completely overlap, the second half has to be coincide

For $ or $ operation, the minimum number obtained $ \ max (a [i], j) $ th a, up to $ \ min (m, a [i] + j) $ th a

For $ xor $, a minimum of a situation which had all the other numbers are offset by a number in this case have $ | a [i] -j | $ a one, then one is all stagger, and that this when there $ \ min (m, a [i] + j) $ th one, but obviously there is another constraint is the number, $ $ XOR result is a zero must be a 0 and a 1 $ XOR $ come, and so it needs $ 2 * ma [i] -j $ taken at $ {\ min} $

Looking for solutions

Set up a $ c $ which has $ num $ months, then $ dp [n] [num] $ If equal to 1, we will be able to find a combination of law program, then we discuss the process backwards

For XOR $ $, assuming $ y $ $ xor $ $ x = c $, $ c $ and we known in a number of $ $ XY, XY seeking $ $, due to satisfy the constraints for a number, we first thought should be in place in the $ c $ 0 to $ xy $ in both a put, in fact, there are several places to put the needs of a 0, can be counted out, there should be $ \ frac {a [ i] + j-num} {2} $, so we find to be more than $ $ XY put a whole, and then the remaining places for $ c $ $ X $ 1 to $ Y $ or put a can

$ And $ and $ or $ simpler, you can look at yourself yy

T3

In other positive solution seems to have root DP and the like, did not look carefully, it has the Gugu Gu

Guess you like

Origin www.cnblogs.com/hzjuruo/p/11366546.html