CP Wiki - LeetCode Solutions

website·Indexed 30 days ago

https://cp-wiki-next.vercel.app

A collection of solutions and algorithmic approaches for LeetCode weekly and bi-weekly contest problems, featuring implementations in languages such as Rust and detailed methods including simulation, greedy algorithms, and two-pointer techniques.

Tokens
565.3K
Snippets
1.9K
Records
2.1K
Agent score
73%

What's inside CP Wiki

  1. Overview of Google Kick Start competition

    Google Kick Start is an entry-level competitive programming (CP) competition hosted by Google. The event consists of 8 rounds held annually between March and November. Each round lasts 3 hours. Since 2020, the format consists of 4 problems per round, and 'Hidden Verdicts' have been removed, meaning all evaluation results are visible immediately.
  2. Introduction to Segment Trees

    A Segment Tree is a tree-based data structure where each node represents an interval $[L, R]$. The left and right children of a node represent non-overlapping intervals whose union exactly equals the parent's interval. Leaf nodes represent single points $[L, L]$. Segment Trees are primarily used for range queries that involve modifications (updates).
  3. Overview of AtCoder Contest Types

    AtCoder organizes competitive programming contests into three primary levels: Beginner, Regular, and Grand. Beginner contests typically occur weekly, while Regular and Grand contests are held on an irregular schedule.
  4. Overview of LeetCode for Competitive Programming

    LeetCode is a platform primarily focused on software engineering job preparation. It is suitable for beginners as the overall problem difficulty is generally lower than other competitive programming platforms. The platform hosts regular contests: Weekly Contests (Sundays at 10:30 AM Beijing Time) and Bi-weekly Contests (every two weeks on Saturdays at 10:30 PM Beijing Time).
  5. Overview of Advent of Code (AoC) Competition

    Advent of Code (AoC) is an annual programming competition created by Eric Wastl. The event runs from December 1st to December 25th each year. New problems are released daily at 1:00 PM Beijing Time. Each daily problem consists of two parts; the first part must be solved before the second part becomes available. Both parts of a daily problem share the same input file. Global leaderboards award points to the top 100 finishers for each part, ranging from 100 down to 1.
  6. Overview of Segment Tree data structure

    A Segment Tree is a tree-based data structure where each node represents an interval [L, R]. The left and right children of a node represent non-overlapping intervals whose union exactly equals the parent's interval. Leaf nodes represent single points [L, L]. Segment Trees are primarily used for range queries that involve modifications.
  7. Overview of LeetCode for Competitive Programming

    LeetCode is a platform primarily focused on software engineering job preparation. It is suitable for beginners as the overall difficulty of its problems tends to be lower than other competitive programming platforms. The platform hosts regular contests: Weekly Contests (Sundays at 10:30 AM Beijing Time) and Bi-weekly Contests (every two weeks on Saturdays at 10:30 PM Beijing Time).
  8. Overview of common sorting algorithms and their applications

    Common sorting algorithms include Bubble Sort, Insertion Sort, Selection Sort, Quick Sort, Shell Sort, Heap Sort, Counting Sort, and Radix Sort. In competitive programming, it is generally recommended to use built-in library functions (which typically implement Quick Sort or Tim Sort for stability) rather than implementing them manually. However, specific algorithms are useful for specialized tasks: Merge Sort is commonly used to count inversions in an array, and Radix Sort is applicable for certain string processing problems.
  9. Overview of common sorting algorithms and their applications

    Common sorting algorithms include Bubble Sort, Insertion Sort, Selection Sort, Quick Sort, Shell Sort, Heap Sort, Counting Sort, and Radix Sort. In competitive programming, it is generally recommended to use built-in library functions rather than manual implementations. Most language libraries use Quick Sort or TimSort (for stability). Certain algorithms are useful for specific problem types: Merge Sort is commonly used to count inversions (e.g., finding the number of reverse pairs in an array), and Radix Sort is applicable to string processing problems.
  10. Overview of Google Kick Start competitive programming contest

    Kick Start is a starter-level competitive programming (CP) contest hosted by Google. The competition consists of 8 rounds annually, occurring between March and November. Each contest lasts 3 hours and typically features 4 problems. Since 2020, the contest has eliminated hidden verdicts, allowing participants to see their results instantaneously.
  11. Introduction to Competitive Programming (CP)

    Competitive Programming (CP) involves implementing specific algorithms and data structures within a strict time limit to solve particular problems. Unlike software engineering, these problems may not always have practical real-world applications and are often used as a form of 'thinking gymnastics' to improve problem-solving skills.
  12. Use Invariants to simplify complex state-space problems

    In problems where the number of possible operation steps is exponential (e.g., $O(2^n)$ or $O(n!)$), it is often impossible to enumerate all states. An 'invariant' is a property or value that remains unchanged regardless of the operations performed. By identifying this invariant and its relationship to the goal, you can solve the problem by calculating the invariant rather than simulating every step.