Welcome to the Competitive Programming Setup repository! This guide will help you set up your environment for competitive programming using Visual Studio Code (VS Code) and Geany. These editors are powerful tools that can enhance your coding efficiency and streamline your problem-solving process.
- Introduction
- Prerequisites
- Setting up VS Code
- Setting up Geany
- Usage
- Contents
- Contributing
- License
- Contact
Competitive programming is a challenging and rewarding activity that involves solving algorithmic problems within a set timeframe. To maximize efficiency, having a well-configured development environment is crucial. This repository provides a comprehensive setup for VS Code and Geany, two popular code editors among competitive programmers. Follow the instructions below to configure your setup and get started with competitive programming.
To set up your environment for competitive programming, ensure you have the following prerequisites installed as per your operating system:
- GCC/G++: Install via MinGW.
- Python: Download and install from the official website.
- Java (optional): Install the JDK from the Oracle website.
- Node.js (optional): Download and install from the Node.js website.
- GCC/G++: Install via package manager:
sudo apt install build-essential
-
Install Visual Studio Code: Download and install VS Code from the official website.
-
Install Extensions: Enhance your coding experience with the following extensions:
- C/C++: Provides IntelliSense, debugging, and code browsing.
- Competitive Programming Helper (cph): Quickly compile, run and judge competitive programming problems in VS Code. Automatically download testcases , or write & test your own problems. Once you are done, easily submit your solutions directly with the click of a button!
- CPH Config
- Install cph in VS Code and open any folder.
- Install competitive companion in your browser.
- Use Companion by pressing the green plus (+) circle from the browser toolbar when visiting any problem page.
- The file opens in VS Code with testcases preloaded. Press Ctrl+Alt+B to run them.
- Install the cph-submit browser extension to enable submitting directly on CodeForces.
- (optional) Add this two lines in your vs code setting.json file (if you use c++).
"cph.language.cpp.SubmissionCompiler": "GNU G++20 13.2 (64 bit, winlibs)", "cph.general.defaultLanguage": "cpp",
- CPH Config
- Code Runner: Allows you to run code and execute custom command easily.
-
Set Up User Snippets: A user snippet typically refers to a piece of code or text that users can insert into a larger codebase or document to accomplish a specific task or function. These snippets are often used to save time, ensure consistency, and reduce errors by reusing commonly used code or text. They can be manually created by users or provided by integrated development environments (IDEs) and text editors to facilitate coding and writing.
- Set Up
- Write your desired code.
- Copy and Paste it into Snippet-Generator website.
- Copy your generated snippet and back to VS Code.
- Click lower-left corner gear icon.
- Then Spnippets -> cpp (or your used language).
- Paste your user generated snippet.
If you faced any problem then watch this YouTube Video N.B: This is my User Snippet(C++). Just Copy Paste. Type ff to trigger code templete.
- Set Up
-
Keybindings (Optional): A keybinding (or key binding) is a specific key or combination of keys on a keyboard that is mapped to perform a particular action within software. Keybindings are used to create shortcuts that can enhance productivity and efficiency by allowing users to quickly execute commands without navigating through menus or using a mouse. These shortcuts can often be customized to suit individual preferences or workflow needs.
- Install Geany: Download and install Geany from the official website.
- Configure Build Commands:
- C/C++: Set up custom build commands for compiling and running C/C++ programs.
- Python: Configure the build menu to execute Python scripts.
- Customize Preferences: Adjust editor preferences for optimal coding efficiency, such as enabling line numbers, syntax highlighting, and auto-completion.
- Set Up Templates: Create code templates for quick access during competitions.
For any questions or feedback, please contact.