Skip to content

Somanshu-Mahajan/java-competitive-programming-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About this template

  • This template is accepted on both Codeforces and Codechef.
  • For Codechef, simply remove public final before the class name to ensure compatibility.

Requirements

  1. Visual Studio Code
    Installation Guide - Amit Thinks
  2. Java
    Installation Guide - Amit Thinks
  3. Git (Optional but recommended)
    Installation Guide - Amit Thinks

Note : Always look for latest version available.

How To Setup ?

  1. Download .vscode folder, Template.java, input.txt and output.txt files from this repository.
    There are two ways to do it:

    • Download the files directly from repository.

      image


      Extract the files to the location where you want to keep your Java files.
    • Using Git (Recommended):

      1. Navigate to the folder where you want to keep your Java files and open the terminal in that folder.
      2. Run the following commands.
        git init
        git clone https://github.com/Somanshu-Mahajan/java-competitive-programming-template.git
  2. Open that folder in Visual Studio Code.

  3. Open all the three files Template.java, input.txt and output.txt in the folder and keep selected Template.java.
    image

  4. Right click on Template.java and select Split Left.
    image

  5. Right click on output.txt and select Split Down.
    image

  6. Type your code in while loop of main function.
    Example: Addtion of two numbers
    image

  7. To run the file press Ctrl+Shift+B. You will get a dropdown at top. Select compile and run.
    image

  8. You will see the output in output.txt file.
    image

Input / Output

  1. No need of Scanner class for I/O operations.
  2. Simply use in. for any input and out. for printing.
  3. Refer to the example shared above.

You are ready to code. Happy coding.

Enjoyed this repo? A ⭐ lets me know it was worth sharing!