The first training camp-February 26, 2010

    This morning, I was mainly familiar with the environment. By the way, I explained the method of the topic of Thursday's trials. I found that many of them were BRUTE FORCE, but I didn't write it out!

    The second thing is to see the old players, like Yang Qian, although they are preparing for the postgraduate entrance examination, they are still here, this feeling~

    It turned out that a Radar problem that was entangled last week was to use Dancing Links to solve the commonly known DLX, and strive to overcome this algorithm.

    The task in the afternoon turned out to be to redo the topic of Thursday...Although it is a bit reluctant, let's do it to increase the proficiency of programming!

    I was very entangled in getting Devil May Cry, after working for a long time, I found that there was a problem with the data. . . . Secondly, the problem of team formation can be optimized by searching and searching, but it is not mainstream. It is very good. It can be a small improvement to AC drop 8 problems in the afternoon. If you create some problems, it may be It has passed and become a pity!

 

Question A is a topological sorting. No one is monitored and can be attacked. It is equivalent to the point that reads 0 can be removed;

Question B is a string match, try to choose the top match, as long as you maintain two pointers;

Question C is a better question. There are 3N individuals (N<=4), give the relationship between hope and unwillingness, and ask whether there is a plan for team success (meeting everyone's requirements)

      It is too easy to think and collect, and the number of more than 3 people can be judged, but it is difficult to judge the "unwilling" situation;

      In view of the small amount of data, BRUTE FORCE can be used, and the efficiency is O(N^(3N)). Because the subject data is relatively weak, the "will" is relatively small. If there are more, the simple method is estimated to be impossible!

 

Question D is a variant of BFS: plots will appear and disappear periodically, find the minimum time from the lower left corner to the upper right corner;

         The description in the question is relatively long, so it is necessary to train a tenacious reading ability; I did not understand the question at the beginning, but inferred the way of walking based on the data in the question, and the result proved to be correct (although it has gone through twists and turns~~~).

         The idea of ​​this topic is still very good:

         1) Picture creation: According to the periodicity, there are at most T pictures, so these T pictures are processed in advance. If the time exceeds T, then just take the modulus of T;

         2) Judgment is heavy: Since it is impossible to go through a point in the same picture, the point can be cancelled after walking;

 

E question judges the prefix suffix, it will be simple to deal with the constant string, but pay attention to clear it in time after processing the prefix;

It passed Thursday, but it didn't happen today~~ It was found that the initial value of a BOOL variable was wrong;

 

I thought about using random for the F question, and later it was also BRUTE FORCE

The general idea: There are N (<=6) hunters and M (<=8) properties. Different properties have different values ​​for different people. Find the extreme difference in the value obtained by hunters after dividing these M properties.

Since an item can only be owned by one person, and a hunter may have multiple items, the item is the stage in DFS.

 

G question is a simple high-precision power;

Question H is wrong ;

 

 

The overall feeling is not too difficult, there is no too difficult algorithm, just practice proficiency and CODING ABILITY

Guess you like

Origin blog.csdn.net/zjsxzjb/article/details/6210175