Each .zip
file contains a settings configuration that you can import into IntelliJ IDEA. These settings configurations aim to make it easier for you to write, test and submit Kotlin code to Competitive Programming contests on various websites.
-
Clone the repository, so that all the
.zip
files are readily available on your system. -
Make sure to save your existing settings using
File
->Export Settings
before proceeding. The next step will overwrite any existing customizations you may have done in your IDE. -
Before starting a contest, go to
File
->Import Settings
, and select thekotlin-cp.zip
to import the relevant settings. For LeetCode, importkotlin-leetcode.zip
instead. And that's it! -
When you're done and you want to bring back your original environment, re-import your original settings from the file you generated in step 2.
-
Create a new project for every contest.
-
Create a new file for each problem. Click on the
src
folder and pressalt + N
to create a new file based on the template. The template contains all common functions for parsing input and writing to stdout, as well as a basic class structure; the places where you need to fill in your code ar marked with// TODO...
. -
If you want to run the Kotlin REPL, press
alt + K
. -
If you want to run your code with input from standard input, press
Ctrl + Shift + F10
. -
If you want to debug your code, press
Shift + F9
.