C++ Level 1
C++ Level 2
C++ Level 3
C++ Level 4
C++ Level 5
C++ Level 6C++ Level 7C++ Level 8
CSP-JCSP-J Round 2 (2020)
CSP-S
2025-12
Theory
Programming
1.(Luogu:)
Solution→
Sample Analysis:
…
Understanding the Problem:
…
Basic Knowledge:
…
Steps to Approach:
…
Code Implementation (C++):
2.(Luogu:)
Solution→
Sample Analysis:
…
Understanding the Problem:
…
Basic Knowledge:
…
Steps to Approach:
…
Code Implementation (C++):
2025-09
Theory
Programming
2025-06
Theory
Programming
1. Holiday Reading(Luogu:B4354)
Solution→
Sample Analysis:
…
Sample 1:
Input: The book has 8 pages, read at most 3 pages per day, and the holiday lasts for 2 days
Analysis: In 2 days, the maximum pages read can be 2×3=6 pages, which is less than the total pages of the book (8 pages)
Result: Can read a maximum of 6 pages
Sample 2:
Input: The book has 19 pages, read at most 3 pages per day, and the holiday lasts for 30 days
Analysis: In 30 days, the maximum pages read can be 30×3=90 pages, which is far greater than the total pages of the book (19 pages)
Result: Can read a maximum of 19 pages (the entire book)
Understanding the Problem:
…
Little A can read at most k pages per day, and with t days of holiday, can read at most k×t pages
However, the total number of pages in the book is n pages, so the actual number of pages read is the smaller of the two values
Essentially, the problem is to calculate the minimum value between “maximum pages read during the holiday” and “total pages of the book”
Basic Knowledge:
…
Multiplication: Calculate the theoretical maximum reading volume during the holiday (maximum pages per day × number of days)
Comparison: Take the smaller of the two numbers (using min function or conditional judgment)
Steps to Approach:
…
1. Calculate the theoretical maximum pages Little A can read during the holiday: maximum pages per day k × holiday days t
2. Compare this value with the total number of pages n
3. The result is the smaller of the two values (since one can only read the entire book)
4. Output the final result
Code Implementation (C++):


2.Duty Day(Luogu:B4355)
Solution→
Sample Analysis:
…
Input: Xiao Yang has duty every 4 days, Xiao Hong has duty every 6 days
Analysis: Need to find the least common multiple of 4 and 6
Multiples of 4: 4, 8, 12, 16, 20, 24…
Multiples of 6: 6, 12, 18, 24, 30…
The least common multiple they share is 12
Result: They will have duty together again in at least 12 days
Understanding the Problem:
…
The essence of the problem: Find the least common multiple (LCM) of two numbers
Definition of least common multiple: The smallest multiple that two numbers share
Today they have duty together, the next time they will have duty together is the least common multiple of their duty cycles
Basic Knowledge:
…
Greatest Common Divisor (GCD): The largest divisor that two numbers share
The relationship between least common multiple and greatest common divisor: LCM (a,b) = (a×b) / GCD (a,b)
Euclidean algorithm: An efficient algorithm for finding the greatest common divisor, based on the principle GCD (a,b) = GCD (b,a% b)
Steps to Approach:
…
1. Calculate the greatest common divisor (GCD) of the two duty cycles m and n
2. Use the formula to calculate the least common multiple: LCM = (m×n) / GCD
3. Output the least common multiple, which is the minimum number of days until they have duty together again
Code Implementation (C++):



2025-03
Theory
ProgrammingCCF Programming Assessment · C++ · (Level 1 2025-03)
2024-12
Theory
ProgrammingCCF Programming Assessment · C++ · (Level 1 2024-12)
2024-09
Theory
ProgrammingCCF Programming Assessment · C++ · (Level 1 2024-09)
2024-06
Theory
ProgrammingCCF Programming Assessment · C++ · (Level 1 2024-06)
2024-03
Theory
ProgrammingCCF Programming Assessment · C++ · (Level 1 2024-03)
Examination Standards
C++ Level 1
1. Understand the basic components of a computer (CPU, memory, I/O devices, etc.), understand the basic concepts and common operations of operating systems such as Windows and Linux, and understand the history of computers and their common applications in modern society.
2. Familiar with the use of integrated development environments (e.g., Dev C++): creating files, editing files, saving files, compiling, interpreting, debugging.
3. Master basic cin statements, scanf statements, cout statements, printf statements, assignment statements, etc.
4. Master the concepts of identifiers, keywords, constants, variables, and expressions.
5. Master the naming, definition, scope, initialization, and assignment of constants and variables, as well as the increment and decrement operations of variables.
6. Master basic arithmetic expressions: addition, subtraction, multiplication, division, integer division, and modulus.
7. Master logical operations: AND (&&), OR (||), NOT (!).
8. Master relational operations: greater than, greater than or equal to, less than, less than or equal to, equal to, not equal to.
9. Master the definition and use of basic data types (integer, floating-point, character, boolean).
10. Master the writing of sequential structure programs.
11. Master the writing of branch structure programs, including if statements, if-else statements, switch statements, and understand the ternary operator.
12. Master the writing of loop structure programs, including the use of for, while, and do-while loop statements, as well as the application of continue and break statements in loops.
13. Understand the concept of program comments and debugging.
C++ Level 2
1. Understand the basic concepts and classifications of computer storage, understand the functions and differences of random access memory (RAM), read-only memory (ROM), and cache memory.
2. Understand the concept of computer networks, understand the classifications of computer networks (wide area network (WAN), metropolitan area network (MAN), local area network (LAN)), understand the hierarchical structure and functions of computer networks (TCP/IP four-layer model and OSI seven-layer model), understand the important protocols at different levels, and understand IP addresses and subnetting.
3. Understand the major classifications and characteristics of programming languages (machine language, assembly language, high-level language), and understand common high-level languages (C++, Python, etc.).
4. Understand the concept of flowcharts and basic symbols, master the methods of drawing flowcharts, and be able to correctly use flowcharts to describe the three basic structures of program design.
5. Understand the basic concept of encoding, understand the principle of ASCII encoding, be able to recognize the ASCII codes of common characters (space: 32, “0”: 48, “A”: 65, “a”: 97), and master the methods of converting between ASCII codes and characters.
6. Master data type conversion: explicit type conversion and implicit type conversion.
7. Master multi-level branch structures, including if statements, if…else statements, switch statements, and methods of nesting.
8. Master multi-level loop structures, including for statements, while statements, do…while statements, and methods of nesting.
9. Master commonly used mathematical functions: absolute value function, square root function, maximum function, minimum function, random number function, and understand the corresponding algorithm principles.
C++ Level 3
1. Understand binary data encoding: sign magnitude, one’s complement, two’s complement.
2. Master data base conversion: binary, octal, decimal, hexadecimal.
3. Master bitwise operations: AND (&), OR (|), NOT (~), XOR (^), left shift (<<), right shift (>>), and their basic usage and principles.
4. Understand the concept and description of algorithms, and be proficient in describing algorithms using natural language, flowcharts, and pseudocode.
5. Basic applications of C++ one-dimensional arrays; basic applications of Python lists, dictionaries, tuples, sets, built-in functions, and the use of list comprehensions.
6. Master the use of strings and their functions, including but not limited to case conversion, string search, splitting, and replacing.
7. Understand the principles and characteristics of enumeration algorithms and simulation algorithms, and be able to solve practical problems.
8. Understand the principles and characteristics of simulation algorithms, and be able to solve practical problems.
C++ Level 4
1. Understand the concept of pointer types in C++, and master the definition, assignment, and dereferencing of pointer type variables.
2. Master the basic concepts and usage of C++ structures, two-dimensional and multi-dimensional arrays; master the nested use of Python composite data types.
3. Understand the modular programming concept, master the declaration, definition, and calling of functions, and understand the difference between formal parameters and actual parameters.
4. Master the concept of variable scope, and understand the difference between global variables and local variables.
5. Master the ways of passing function parameters: C++ pass by value, pass by reference, pass by pointer; Python pass by value, pass by reference.
6. Master the basic ideas of recursive algorithms, the derivation of recursive relations, and the solution of recursive problems.
7. Master the concept of sorting algorithms, understand the concepts and differences between internal sorting and external sorting, and understand the time complexity, space complexity, usage scenarios, and stability of sorting algorithms.
8. Master the algorithmic ideas, sorting steps, and code implementation of bubble sort, insertion sort, and selection sort.
9. Estimate the complexity of simple algorithms, including polynomial and exponential complexity.
10. Master redirection in file operations, implement file read and write operations, understand the classification of text files, and master write operations, read operations, and read-write operations.
11. Understand the exception handling mechanism, and master common methods of exception handling.
C++ Level 5
1. Master the concepts and applications related to elementary number theory, including prime and composite numbers, greatest common divisor and least common multiple, congruences and modular arithmetic, divisors and multiples, prime factorization, parity, etc.
2. Master the knowledge related to simulating high-precision addition, subtraction, multiplication, and division using C++ arrays.
3. Master the creation, insertion, deletion, traversal, and reversal operations of linked lists, and understand the differences between singly linked lists, doubly linked lists, and circular linked lists.
4. Master the principles and applications of the Euclidean algorithm (also known as the Euclidean algorithm), the Sieve of Eratosthenes for prime tables, and the unique factorization theorem.
5. Master methods for estimating algorithm complexity (including polynomial and logarithmic complexity).
6. Master the basic principles of binary search and binary answer algorithms (also known as binary enumeration methods), and be able to quickly locate target values in ordered arrays.
7. Master the basic principles of recursive algorithms, be able to apply recursion to solve problems, and be able to analyze the time complexity and space complexity of recursive algorithms, and understand optimization strategies for recursion.
8. Master the basic principles of greedy algorithms, understand optimal substructure, and be able to use greedy algorithms to solve related problems.
9. Master the basic principles of divide-and-conquer algorithms, and be able to use merge sort and quicksort to sort arrays.
C++ Level 6
1. Master the basic concepts of trees, and master the related algorithms for construction and traversal.
2. Master the concepts and applications of Huffman trees, complete binary trees, and binary search trees.
3. Understand the principles of Huffman coding and Gray coding, and be able to perform simple applications.
4. Master the concepts and applications of depth-first search algorithms (DFS), breadth-first search algorithms (also known as breadth-first search algorithms, BFS), and binary tree search algorithms, and be able to choose appropriate search algorithms based on real-world problems.
5. Master the basic ideas of simple dynamic programming algorithms, and be able to use code to solve corresponding one-dimensional dynamic programming problems and simple knapsack problems.
6. Master the concept of object-oriented programming, understand the basic concepts of encapsulation, inheritance, and polymorphism, and master the creation and basic usage of classes.
7. Master the basic definitions, application scenarios, and common operations of stacks, queues, and circular queues.
C++ Level 7
1. Master commonly used functions in the math library (trigonometric, logarithmic, exponential), including trigonometric functions such as sin(x), cos(x); logarithmic functions such as log10(x): returns the logarithm of x to the base 10, log2(x): returns the logarithm of x to the base 2; exponential functions such as exp(x): calculates the exponential function, returning the exponential function of x to the base e.
2. Master complex dynamic programming (two-dimensional dynamic programming, dynamic programming optimization). This includes interval dynamic programming, longest increasing subsequence (LIS), longest common subsequence (LCS), etc., and understand methods to reduce the space complexity of dynamic programming based on rolling arrays.
3. Understand the definition of graphs and basic graph theory algorithms. This includes the definition of graphs, types of graphs (directed graphs, undirected graphs), and the concept of the degree of graph nodes. Master the data structure representation of graphs in programming, as well as graph search and traversal methods based on depth-first search (DFS) and breadth-first search (BFS), and the flood fill algorithm.
4. Master the concept and knowledge of hash tables and their applications.
C++ Level 8
1. Master the principles of counting, including the addition principle and multiplication principle.
2. Master the basic knowledge of permutations and combinations, including the basic concepts of permutations and combinations, and the general methods for implementing basic permutation and combination programming problems.
3. Master the concept of Pascal’s triangle (also known as Yang Hui’s triangle).
4. Master the concept of doubling methods. Understand the time complexity of doubling methods.
5. Master the basic knowledge of algebra and plane geometry (middle school mathematics). This includes the concept of equations and basic solving techniques for linear equations, as well as finding basic geometric concepts and calculating the area of basic shapes (such as rectangles, triangles, circles, etc.).
6. Master graph theory algorithms and comprehensive application techniques. This includes the concept of minimum spanning trees, Kruskal’s algorithm, Prim’s algorithm, and the concept of shortest paths, Dijkstra’s algorithm for single-source shortest paths, Floyd’s algorithm, etc. Understand the comparison of different algorithms that achieve the same function, and be able to flexibly solve related problems.
7. Analyze the time and space efficiency of algorithms. Be able to master the time and space complexity analysis methods of more complex algorithms, and analyze the time and space complexity of various algorithms (including sorting algorithms, searching algorithms, tree and graph traversal algorithms, search algorithms, divide-and-conquer algorithms, and dynamic programming algorithms).
8. Algorithm optimization. Understand the differences in time complexity and space complexity of different methods for solving a problem, and understand the techniques for using mathematical knowledge to assist in problem-solving (for example, one can use loops to find the sum of an arithmetic series, or one can use a mathematical formula to find the sum of an arithmetic series), and master general algorithm optimization techniques.
Reference Books

