< Back
October 08

TPC Setup Guide ๐Ÿ› ๏ธ

Welcome freshers! Starting with Competitive Programming (CP) can be a bit overwhelming, especially when you just want to code but your computer says no. ๐Ÿ˜… So here is a quick guide to get you up and running. Bear ๐Ÿป with me!

Windows ๐ŸชŸ

  1. Make sure you have Terminal app installed in your system. You can do so by searching for Terminal in windows start menu.

If you donโ€™t have the Terminal app you can install it from the Microsoft Windows Store.

  1. Check if you have g++ installed by typing in g++ --version. If it returns a version you are all set and can move on to the VS Code setup.

  2. If not, no worries. Visit Scoop.sh. Copy the Given commands show right below QuickStart. Same commands are pasted below for reference.

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Invoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expression

Copy the commands given above and paste them in your Terminal.

If you experience any errors try updating your Powershell app from the Microsoft store, Or switching to a better internet connection.

Close and reopen your Terminal.

  1. On Scoop.sh Search for Mingw. Find the one labelled as mingw in main. Futher paste the given command in your Terminal.
scoop install main/Mingw

If you get an error saying โ€œscoop is not a valid commandโ€. Try closing and reopening your Terminal.

  1. Close you Terminal and reopen it. Type in g++ and voila! You have the mingw compiler installed and running.

MacOS ๐ŸŽ

  1. Open Terminal in MacOS. Check if you have g++ installed by typing in g++ --version. If it returns a version you are all set and can move on to the VS Code setup.

  2. If not, no worries. Check if you have brew installed by typing in brew --version. If you have brew Installed you can skip to step 6.

  3. If not, Head on to Brew.sh and copy the given command and paste it into your terminal.

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  1. Once you have brew installed, type in brew install gcc in your terminal.

  2. Once the installation is complete, type in g++ --version to check if the installation was successful. If you see a version you are all set.

VS Code ๐Ÿ’ป

  1. Download VS Code from Code.visualstudio.com. Beware Visual Studio Code and Visual Studio are two different programs. Vs code is a code editor while the latter is a full fledged IDE.

  2. Download the Coderunner extension using the VS code extensions tab.

  3. Go to extensions > Coderuner > Coderunner Settings. Further look for Run in Terminal and tick the box. Then go ahead and also tick the box for save file before run.

  1. Once you have Coderunner downloaded letโ€™s create a new file with Ctrl+n. Input this basic hello world program in C++.
#include <iostream>
using namespace std;

int main() {
    cout << "Hello World!";
    return 0;
}
  1. Save the file with a .cpp extension, at your desired place.

  2. Now press Ctrl+Alt+n to run the code. You should see the output in the terminal below.

  3. If you see the output you are all set!.

Competitive Programming ๐Ÿ†

Now letโ€™s setup all the conveniences for Competitive Programming. We want to make it as smooth as possible so you can focus on the logic!

  1. Download the Competitve Programming Helper extension from the VS Code extensions tab.

  1. Go to your preferred browser, Firefox/Chrome recommended. Install the Competitive Companion extension.

Firefox link - https://addons.mozilla.org/en-US/firefox/addon/competitive-companion/

Chrome link - https://chromewebstore.google.com/detail/competitive-companion/cjnmckjndlpiamhfimnnjmnckgghkjbl

  1. For you convenience create a new folder on your system for all you competitive programming files.

  2. Now you are all set to start your competitive programming journey. Good luck!

I hope this guide helps you get started. If you run into any issues, feel free to reach out. See ya! ๐Ÿ‘‹

~ with ๐Ÿ’– by Om.

< Back