Skip to content
| Marketplace
Sign in
Visual Studio Code>Snippets>CP Snippets for C++/JavaNew to Visual Studio Code? Get it now.
CP Snippets for C++/Java

CP Snippets for C++/Java

Abhishek Chaurasia

|
11 installs
| (0) | Free
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

CP Boilerplate Snippets

🚀 A VS Code snippet extension containing competitive programming boilerplates for C++, Java, and utility snippets for common CP patterns.


Features

This extension provides pre-written boilerplate code and common code snippets for competitive programmers.

C++ Snippets

Prefix Description
contest Full C++ CP template with fast I/O, macros, solve() function, and test cases loop.
iostream Basic C++ program structure using <iostream>.
Node Binary Tree Node class definition.
array Function to print an array.
print Loop to print a vector.
vvpi 2D vector of pairs declaration.
sieve Sieve of Eratosthenes implementation.
lps Compute LPS array for KMP string matching.
dsu Disjoint Set Union (Union-Find) data structure with path compression and union by rank.

Java Snippets

Prefix Description
contest Java CP template with FastReader for fast input.

How to Use

  1. Install the extension in VS Code (development mode or via marketplace).
  2. Open a .cpp or .java file.
  3. Type one of the prefixes (e.g., contest) and press Tab or Enter.
  4. The corresponding boilerplate/template will be inserted automatically.

Why Use This?

  • Save time during contests by avoiding repetitive typing.
  • Standardize your template for speed and efficiency.
  • Access commonly used algorithms and data structures with just a short prefix.

Future Plans

  • Add Python CP templates.
  • Add more common algorithms (DSU, Segment Tree, Graph algorithms).
  • Support custom user-defined templates.
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft