competitive-programming

Competitive Programmer's Core Skills by Saint Petersburg State University


Project maintained by claytonjwong Hosted on GitHub Pages — Theme by mattgraham

Week 1: Programming Competitions

Key Concepts

Resources

  1. Competitions
  2. Testing

Assignments

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

Week 2: Correctness First

Key Concepts

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

Week 3: Common Struggles

Key Concepts

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

Week 4: Technical Problems

Key Concepts

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

Week 5: Dynamic Programming

Key Concepts

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

Week 6: Dynamic Programming 2

Key Concepts

Resources

Assignments

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