lzoi race simulation solution to a problem

A question: attendance title
original title: A title mtoi League
Orientation: true sign title (title or increase the popularity of B d1A title).
Test sites: the basic mathematical abilities players
difficulty thinking: improve -
Code difficulty: A popular title

Solution: 80%: enumeration violence
100%: note (a xor b) <= ( a + b), then all the numbers up to the exclusive OR.

Problem B: send sub-themes
of the original title: [provincial team with multifunction Province] d2A: Leather and
positioning: a league title d1B investigated the basic skills of the players. Send the player 70 points. 70% of the two kinds of solutions to obtain a positive approach can be extended
test sites: more backpack dp, counting
difficulty thinking: improved
Code difficulty: increase +

Several previous violence enumeration data can be resolved.
50% of the data: Consider dp. Setting f [i] [x] [ y] represents the school before i select blue camp there are x, y choose a duck faction has. He shifted easily. You can use the scroll array optimization.
20% of additional data: Noting k = 0, then find the "Select camp" and "Select faction" these two operations are noninteracting. Then you can directly do.
Consider all schools according to city numbers in ascending order.
Set f [i] [j] represents the i dp cities, select the number of blue camp having j.
g [i] [j] dp represents the i-th school, choose the number of ducks factions having j.
It can be transferred in accordance with the ordinary backpack. Then just calculate the answer using the multiplication principle.
100% Data: Note that all data k <= 30, so there is no school like a small number of mentors. Dp may be extracted separately.
But above f, g is defined to be modified to: f [j] represents the i dp cities (there is no preference of school) (i scroll out), select the number of ducks factions having j.
g [j] dp represents the i-th school (no preference) (i scroll out), select the number of ducks factions having j. Can be shifted easily.
Consider setting f1 [i] [j] represents the current city (there must be at least a preference of school) in the blue camp, and there are individuals in the duck j factions (there is a personal faction in the z [i] -j) Number Scheme . Set f2 [i] [j] represents the current city (there must be at least a preference of school) in the red camp. J and has factions individual Ap (with a [i] -j individual faction z) number of programs.
After each dp f2 consider the contribution to the consolidation f1.
Each time, the first copy to the f2 f1.
Then enumerate every school, transferred according to their preferences.
In the update finished f1, after f2, can enumerate this city choose red or blue camp camp. Use f1 [xa [i]] [ y] + f2 [x] [y] updated f1 [x] [y]
(Front significance of this is: all have chosen the blue camp, meaning the latter is: all have chosen red camp).
Finally enumeration x, y, with f1 [x] [y] and f, g update the answer.
Pit: not to skip school city, or only 20 points.

C title: Water question
the original title: loj noip simulation game d1C title: tours
Orientation: d1C a league title, examines the thinking ability of the players. The effects of a variety of algorithms.
Test sites: dichotomy, like matrix multiplication, multiply, dp
difficulty thinking: increase +
Code difficulty: to improve -
in front of the data: blind dp, blind enumeration, the (moving) questions people do not consider this approach (in fact, is not too weak to write come out). Some parts can get points.
Out algorithm: Let f [i] [j] is now represented in the sights i, and be sure to refuel in the sights i, j surplus dollars, you can take the maximum distance.
If j <p [i], then f [i] [j] = 0.
Otherwise enumeration next refueling position j. Obtain the following transfer equation:
F [I] [J] = max {F [K] [JP [I]] + W [I] [J] [min (C [I], C)]}
explain: k is next to refuel the city, w [i] [j] [k] represents the elapsed does not exceed the maximum k road away from i to j.
W [] [] [] may be calculated violence dp. Can be enumerated a to i can be a departure city l
then w [l] [j] [ k-1] may be transferred w [i] [j] [ k].
But violence dp too slow. Consider doubled.
To change the state definition:
W [I] [J] [K] represents i-> j is not more than 2 ^ k through paths of the maximum distance. L can enumerate a transit point for the transfer. EQUATION:
W [I] [J] [K] = min {W [I] [L] [-K. 1] + W [L] [K] [K-. 1]}
Note that this calculation is actually the matrix multiplication * replaced +, + into the take min, the fact is associative.
Pretreatment can be a w [i] [j] [ k] ( i.e., log matrices).
When asked w [i] [j] [ min (c [i], C)], may be used a 1 * n matrix of the matrix by the answer. The value 1 * n matrix in [1] [i] bit is 0, the other is infinite. The min (c [i], C ) the binary split and multiplied for each bit corresponding to a matrix.
Noting F [I] [] monotone, take any two integers j, k (j <k) , is f [i] [j] < = f [i] [k]. (In fact, is "starting from i with more money, you can go further"). You may be f [i] [] which is larger than the first-half position d p, the q p can be obtained by subtracting the answer.
Then, for each query can be treated as described above.

Summary: This is a difficult slightly less than last year, d2, d1 is larger than last year's race simulation. Focusing on basic skills test players.
For the average player, A certain problem thinking long after, in 10min you can think out of the
B group title so long as the popularity of backpacks dp, you can get 50 points, good results. And then only to note that k = 0, select and camp factions select independent of each other can get 70 points.
Problem C fucks casual violence can get from 0 to 60, ranging from good results.
1 = I expect line between 130 to 160. Few players over 240 minutes, less of ak.
A problem which some pot, missed a condition when writing the title, later to be careful.
Up late in the morning, did not answer questions about the students in a timely manner. And also there is some data pot, apology here.

Guess you like

Origin www.cnblogs.com/rilisoft/p/11518682.html