This repository contains my solutions to the CSES Problem Set, which I’m working through as practice while reading Guide to Competitive Programming by Antti Laaksonen.
- Each problem has its own file, and all solutions are organized into folders by problem set topics.
- A base template
_template.js
is included, which handles reading fromstdin
and is suitable for direct submission to CSES.
- Practice problem-solving and algorithmic thinking.
- Improve speed and accuracy in competitive programming.
- Apply techniques from the book to real problems.
Running automatically with VS Code tasks
Run any CSES solution interactively with multi-line input and automatic reruns for testing.
- Make the loop script executable:
chmod +x .vscode/scripts/loop.sh
-
Run the VS Code task
Run CSES solution
, pick the folder (topic), and enter the script name (without*.js
extension). -
Type your input (multi-line supported), then press Ctrl+D to run the script.
-
After execution, press Enter to rerun or Ctrl+C to quit.
CSES Node.js version support: https://cses.fi/howto/
Set up calling nvm use
automatically with .nvmrc
file - https://github.com/nvm-sh/nvm?tab=readme-ov-file#calling-nvm-use-automatically-in-a-directory-with-a-nvmrc-file