"Algorithm contest - from entry to advanced" essay (1)

 The first chapter outlines the algorithm competition 
algorithm contest (Programming Contest) is a shortcut to cultivate outstanding programmers.


 

In many domestic competitions, junior high student-oriented programming contest have National Olympiad in Informatics (NOI), the most influential programming contest for college students there ACM-ICPC (International Collegiate Programming Contest), CCPC (Chinese college students programming contest)

The culture of outstanding programmers shortcut: 1 to write a lot of code; 2. a wealth of knowledge algorithm; 3. computing and logic thinking; 4. team spirit.

Algorithm contest entry: 1. Competition team principal to learn is to "brush title"; 2 reflect summary (template learning).

Talent and hard work. Talent decided to limit efforts to determine the lower limit.

Modeling capabilities. The template is very useful, its main importance is to help players understand classical algorithm, but can not necessarily be in the game. The real learning is to master the idea behind the algorithm, not only back algorithm. In learning not to pursue the "quantity" algorithm to learn, but to grasp its "ideological." In fact, many thought the algorithm is the same. From this point of view can better understand the "quality"> "quantity."

Improve programming speed, the most fundamental thing is to pass a lot of exercises to improve proficiency in coding, "without him, but the hand-cooked Seoul!"

Code chapter

1  // end of input mode 
2  
. 3  the while (~ Scanf ( " % D% D " , A &, & B))
 . 4  
. 5  // upon competition, it is not recommended method of determining the EOF.
6  // input and output efficiency 
. 7  
. 8 // in the C ++ language, the input and output common statement is cin, cout, advantage is very convenient. 
  // Note, however, compared with scanf (), printf (), cin, cout efficiency is very low, very slow. If you have a large number of test data subject, it may result in TLE.
. 9 10 // coding techniques. 1 . 11 typedef Long Long LL 12 is 13 is then Long Long A = 123456789 ; 14 becomes simple: LL A = 123456789 15 16 // encoding Tip 2 17 best not to use macros. Whether macro definition or macro functions are easy to go wrong 18 Do not use #define define constants, but with the const define constants, such as 19 20 const int MAX = 1000005 ; 21 22 Ba macro function written in an ordinary function

 

Recommended examples in this chapter:

P2482 [SDOI2010] kill pigs States

P2586 [ZJOI2008] kill ants

 Reference:
OI events and competition system

National Olympiad in Informatics (NOI)

IQ much effect on people's success?

Girls learn how informatics contest is an experience?

Guess you like

Origin www.cnblogs.com/cspjs/p/12033136.html