The first school was the eleventh day of training camp: OI Alchemy

Thesis

      Today the teacher to teach us is very interesting.

      Not just some questions to us, there are some methods start with the question of how to face the problem into a solution to a problem is the most important.

      OI players frequently encountered pain points

      After seeing Solution: ah, well simple, why did not I think of that?

      I think this problem out, but that *** I can not write ah? ! ! !

      Huh? There seems to bug ...... ( AN hour later ) also adjust how not ah! zbl

      Determinants of winners and losers

      1, the ability to think out of the solution

      2 , the ability to write programs

      3, the ability to tune to the program

      4 , fucks capacity

      . 5, A Class plus

      The ability to think out of the solution

      The examination room is not the solution to a problem! ! ! ! ! The examination room is not the solution to a problem! ! ! ! ! The examination room is not the solution to a problem! ! ! ! !

      All your sources of information from the full title side. Therefore, to take advantage of all the information in the face of good questions, including data range

      Example 1: BJOI 2016 air strikes

      Now our army scout GloryKen are practicing how air strikes a "bloodthirsty predators" (also known as the "three dog"). The terrain can be seen as N × M grid, the grid has some obstacles impassable. There is an enemy unit "three dog" on the ground. In the next period of time, scouts GloryKen will it be several air strikes. The specific process can be described by turn. The initial position of the dog in the three coordinates ( X, Y ) , for a vertical and horizontal directions. Each round consists of the following phases.

1. GloryKen issued an "air raid instructions" friendly air support troops immediately fired a missile. Fengyun missile will ai hit three dogs in front of the current position after rounds ai lattice grid (where the "front" refers to the direction of the three current-facing dog.). If this position is outside the map, then the failure of the raid.

2. The three dogs a "movement." It can move up and down a grid (not out of bounds, it can not reach a lattice of obstacles exist), you can also choose to stay in the current grid. If you move, it will turn toward the direction of movement, otherwise it's the same face.

3. Before all scheduled to reach the round of missiles all arrive simultaneously at a predetermined position, if three dog hit by a missile, it would die immediately. Missiles will not affect the terrain, that will not destroy the barriers, it will not create obstacles.

Now, GloryKen wondering, T after rounds of air strikes, if only three dogs still alive, its location may be where. So, you need to find, for each grid, only three dogs how many programs can be the first T just arrived in the plaid round, and survival. Two different schemes, if and only if you select a different move round three dogs.

( N, M 20 , T 50 , have 12 )

      Analysis process:

      1 , the number of programs seeking à the DP

      2 , all of the data range are super small à able to remember array - a relatively large construction space

      3 , in ai after three rounds hit the dog in front of the current position ai lattice grid - as long as the bend of a turn or stop, Fengyun missile scrap it - just remember how much current can step straight enough

      4 , the key information added to the other apparent DP array (position coordinates, the number of rounds, orientation), to give a final solution - a five-dimensional large DP

      Example 2: NOIP2017 the park

      N to a point, M has the edges weighted graph, the length between the starting point Q path length + K path number of the answer to P modulo

      N100000 M200000 K50

      Analysis process:

      Number of Program Number - the DP

      Absolute path length is too big, not remember array - changed with respect to the shortest path increments

      The answer to infinity - not a DAG time

      Example 3: NOI2018 bubble sort

      The lower bound bubble sort \frac{1}{2}\sum|i-p_i| , a given length of n are arranged q , Q strictly greater than lexicographically q arrangement, the switching frequency is equal to the number of bubble sort arranged lower bound.

      At first glance count - the number of bits Dp

      Each position represents a lower bound only want to target position, there can be cost-step, that is, in the sorting process, there is no point to go a step to the left and then take a step to the right.

      And we know, when a point to go to the left and only if there is bigger than its left. Go right if and only if there is less than its right side, so it is clear that the restrictions for a point, can not be smaller than the left to the right of a majority.

      So either take the smallest current point in the rest of the figures, the left or take large ratio.

      Then digital DP transfer schemes it.

      Third question: NOI2016 range

      Give some intervals [L_i.R_i] , to choose the m intervals, so that the intersection is not empty, ask all the options, the selected longest interval length minus the selected minimum interval length is the shortest how much?

      Can be directly sorted by length, and then again Two_Pointer sweep, open a segment tree is added at a recording interval, and if the maximum value in the segment tree == m then there is a solution, directly to the left point to the right continues until there are no m on it.

      Consider how to come up with a solution to a problem: the interval only two things, one is the position of the interval, the interval of a length, respectively, think about it.

      Section

      In the case of the topic can not be one second away (one second can usually classical model, NOI certainly not rely on this part of the showdown), combined with the knowledge learned calmly analyze all the elements that appear in the title can be relatively stable get answers. Exercise usually pay more attention to every question did not want to come out of the final launch of the elements of the answer, think of how to think about this solution is in the process of looking solution to a problem. In theory, can make their own medals increased by one grade under the premise the same level of knowledge, this is the OI Alchemy (commonly known as the thinking ability).

      The ability to write out the program & the ability to tune to the program

      And more familiar with the board

      Modular the code (written in the structure)

      10 expertly write various data structures you completed within minutes

      I learned to write out what is also critical, often to review some of the review board, when the game has far-reaching effects.

Guess you like

Origin blog.csdn.net/Deep_Kevin/article/details/98095018