ACM started

xiaoxiao2021-03-06  74

Ah, I can't think of there will be a fast 300 teams today. . . In fact, it is not too worried, it should be, 300 election 60, according to the strength, I still have the opportunity, because usually 8 questions we can make 3 questions, and in the finals can do 3 questions must be three-class Let's take it, do so much, even if you don't enter the finals, I have learned a lot of things, still worth it, come on, everyone is working hard, class can not get up. , Full ACM, first enter the final, this is the most critical task. Well, a record of the record, save it. Some small details. Come on, rest ~~~ ----------------------------------------- -------------------------- 1. Complete Hungarian algorithm, master the two points. 2. Complete the depth search algorithm, which has been further understood. 3. There is also a task: weighted two-point match, HUFFMAN encoding (poly), further master of search, and use case reinforcement network flow algorithm

And minimum cost maximum stream algorithm, two-point matching algorithm. Separable to completion of weighting and huffman tomorrow, and then getting the online stream and the most

Small cost flow.

-------------------------- 10.4 ----------------------- ------------------ 1. Complete the maximum network stream algorithm, and can use it to solve the matching problem, but the time v ^ 2 * e, and the simple Hungarian algorithm Time

As long as V * e. It is a bit different from the general book. It adopts the node of two groups, the expansion, only the node that has not been marked.

There is no expansion of the node that is being marked and the marked. 2. Complete the minimum cost of the minimum cost, with the shortest path method, where you want to use a negative circle method, but unfortunately I didn't find how to seek a negative algorithm, so

Still use ZDF's shortest path method. Note Some is negative while calculating the shortest path, plus the path, still in the original

However, it is necessary to divide it into two sides due to the right time, and there must be no two sides of the original two points.

-------------------------- 9.25 ----------------------- ------------------ 1. Solved the O (n ^ 2) algorithm for the minimal bonus tree, but there is a big bug, did not get it four hours, after lijunwei Specify, heavy

Inficing the topic is not enough, that is, in the stored matrix, pay attention to 0 means it, it is possible to indicate that there is no side between two points, there is also

It may indicate that there is a side, but the weight is 0. When the graph is calculated, it is possible to take care of the .2.1496 classic shortest path algorithm, record the front node, you can easily find a record of the dictionary order, be careful, in the knot Point (i, i)

When the output is i, it can be understood after doing this for more than a dozen times. This is also a common mistake, don't talk

In the last data, it is allowed to pay back, and it is not possible to go back to the car.

------------------------- 9.25 ---------------------- ------------- 1. Remember that the space of the sweep is also wrong. For example, the output is 1 2 3 If there is a space behind it, it will generate Presentation. Error !!! Solution is to lose the first number first, then the space is again recycled!

The 2.int main () function does not pick up RETURN 0; it is also possible to compile, for rigorous can add RETURN 0; 3. Don't forget to go to System ("Pause") or cin.get (). Pause screen statement

4. Set the domain wide function: First use the library, then there are two methods, one is Cout.Width (10); cout << "aabb"; the other is Cout << SETW (10) < <"aabb"; only affects one line. 5. Note Memset, it only contains in the library, and once MEMSET (C, 0, 10) means using 0 continuous fill 10 bytes ,

If the definition of C is C [10], then the sentence can only be filled with three units, the correct practice is MEMSET (C, 0, 10 * 4), if there is MEMSET

(C, 300, 10 * 4), then fill each byte 44 (44 = 300-256, take high, low).

6.ASCII code table: 48 ~ 57 value is 0 ~ 9 65 ~ 90 a ~ z 97 ~ 122 a ~ z

7 Isdigit (Char) and Isalpha (Char) are in the library

8. Best use of library under cPP without library

9 pi 3.141592653589793

10.float is 4 bytes, like INT, Double type is 8 bytes.

11. Set N-bit accuracy by cout.precision (n), just set once, will always affect ... precision (n) means setting effective numbers to n bits, including the front part of the decimal point, and 0 Give it, and more

Reading one to go all right. If cout.precision (5) t = 111.104, the output is 111.1, if t = 111.106, the output is 111.11

12. Effective digital bits after decimal point: cout.Precision (4); cout << fixed << 11.111000; will output 11.1110

13. / / Maximum number of LONG long gcd (long long n, long long m) {if (m == 0) Return N; Else Return GCD (M, N% M);}

// Minimum male number long long LCM (long long n, long long m) {return m * (n / gcd (n, m));}

14. When doing digital processing, be careful when doing digital processing, char [i] - '0' will process, not directly take char [i], cut

Record..

15 Set the right alignment, the domain width is in the library, cout << setw (5) << n; to set. -

转载请注明原文地址:https://www.9cbs.com/read-109706.html

New Post(0)