Programme

We divide the whole programme into three levels corresponding to three classes.#

L1 Elementary

  • Introduction:
  • Input/output data: cin, cout, getline
  • Basic data types: int, float, bool, string, char
  • Variables: declare and init a variable, change the value of a variable
  • Basic operators: assignment (=), arithmetic (+, -, *, /, %), relational (==, >, <), logical (and, or, not)
  • if-then-else
  • How a C++ programme runs
    • Statement by statement
    • Block of code
    • Variable scope
    • Variable initialisation
  • for loop:
    • Simple loop: 0 to n
    • All even/odd numbers
    • Loop with break
    • Two-layer nested loop
  • while loop:
    • while loop as for loop
    • With conditions
  • Vector: declare and initialise a vector, push_back, access elements
  • String: declare and initialise a string, access elements
  • Basic algorithms: min, max, sum, swap, etc.
  • Introduction to (no coding):
    • ASCII
    • Binary numbers
    • Functions with/without parameters

Testing: Manually (i.e., home-made tests), Perse Round 0

L2 Intermediate

  • Remind: How a C++ programme runs
    • Block of code
    • Variable scope
    • Variable initialisation
  • Big integers: int64_t
  • Vector and String: more complicated problems
  • Loops: more complicated loop structure
  • Algorithms:
    • Second min/max
    • String manipulations: upper/lower, compare, replace/remove substring
  • Discrete maths:
    • Prime numbers
    • GCD
    • Modulo
    • Fibonacci
    • Binary numbers and related operators
  • References and values
    • Pass values to a function
    • Pass reference to a function
  • unordered_map
  • Functions: write and use functions with string/vector parameters
  • Simple (time) complexity: O(n), O(n^2)
  • Pair/Struct
  • Bubble sort
  • Common mistakes in competitive programming

Testing: Codeforces (DIV4), Leetcode (easy problems)

L3 Advanced

  • Creative thinking in competitive programming:
    • Aim at first 4 problems of CodeForces Div-4
    • Aim at first 3 problems of CodeForces Div-3
  • Advanced data structures: Linked list, Heap/Priority queue, Dequeue, Binary search tree
  • Binary search
  • Priority queue
  • Graphs: Breadth-first search, Depth-first search
  • Recursive
  • Sorting: QuickSort, MergeSort, etc.
  • Algorithms: Shortest path search, Dynamic programming

Sources: Leetcode, Codeforces, Perse

Testing: Codeforces (DIV2, DIV3 and DIV4), BIO, Facebook hacker