Skip to content

🥇 Competitive Programmer's Core Skills by Saint Petersburg State University

Notifications You must be signed in to change notification settings

claytonjwong/competitive-programming

Repository files navigation

Key Concepts

  • Know various strategies for inventing test cases and testing programs
  • Understand what programming competitions and algorithmic problems are, what's the difference compared to other forms of programming
  • Learn about various platforms dedicated to competitive programming, and what opportunities they offer

Resources

  1. Competitions
  2. Testing

Assignments

  1. Inventing Tests
  2. Addition and Subtraction
  3. Erasing Maximum
  4. Increment
  5. Straight Flush

Key Concepts

  • Deduce simple upper bounds on a solution's running time and decide if it's fast enough for a given time limit
  • Implement brute force solutions with basic recursive backtracking
  • Understand the connection between code structure and the logic behind it

Resources

  1. Structuring Code
  2. Brute-Force Solutions: Always Conceptually Correct (but extremely slow)
    • Intuitive "Proofs" are Wrong
    • Defining Solution Set
      • Search Space (ie. set A)
        • Find an element of a set A which satisfies some property
        • Find an element of a set A which minimizes/maximizes an objective function
        • Find the number of elements of a set A satisfying some property
    • Recursive Backtracking: Code equivalent to N nested for-loops
      • Recipe for developing a brute-force solution:
        • Identify the search space for a problem
        • Design a method to enumerate all elements of the search space
  3. Time Complexity: Estimating the number of unit operations in an algorithm

Assignments

  1. Quiz
  2. The Cheapest Permutation
  3. The King
  4. Sum of Minimums
  5. Expression Evaluation

Key Concepts

  • Know how integers are represented
  • Identify places where integer overflow happens
  • Know and compare different ways of representing non-integers, including floating point arithmetic
  • Handle precision issues when performing basic operations with doubles
  • Distinguish common situations when solution could be simplified by replacing doubles with integers
  • Apply code structuring to simplify debugging
  • Auto-check program correctness by identifying invariants and inserting corresponding assertions
  • Understand motivation and strategy for upsolving

Resources

  1. Insidious Numbers
  2. Getting Unstuck
  3. Binary Knapsack Solution

Assignments

  1. Quiz
  2. Compare Sums
  3. Round Up
  4. Yet Another Sum
  5. Binary Knapsack

Key Concepts

  • Invent basic greedy solutions and prove their correctness
  • Understand what programming language features are most important on competitions
  • Know specialties of popular programming languages
  • Apply the segment tree data structure to solve problems which require answer queries of certain form

Resources

  1. Greedy Algorithms
  2. Segment Tree
  3. Language Specifics
  4. Maximal Sum Subarray Solution

Assignments

  1. The Most Frequent Symbol
  2. Maximal Distance
  3. Multiset
  4. Maximal Sum Subarray

Key Concepts

  • Subproblems (and recurrence relation on them) are the most important ingredient of a dynamic programming algorithm
  • Two common ways of arriving at the right subproblem:
    1. Analyze the structure of an optimal solution
    2. Implement a brute-force solution and optimize it

Resources

  1. Dynamic Programming
  2. Make It Sorted Solution

Assignments

  1. Longest Increasing Subsequence
  2. Edit Distance
  3. Sum of Digits
  4. Make It Sorted

Key Concepts

  • Recursive vs Iterative
    • Recursive Advantages
      • May be faster than iterative if not all subproblems need to be solved
      • Easier to implement since the subproblem order is implicitly found by the recursion
    • Iterative Advantages
      • No recursive stack overhead
      • Memory optimization to only store the previous and current rows

Resources

Assignments

  1. Knapsack
  2. Chain Matrix Multiplication
  3. Longest Common Subsequence
  4. Maximal Sum Square

About

🥇 Competitive Programmer's Core Skills by Saint Petersburg State University

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published