- π Kattis Profile
- Total problems solved: 102
- π Directory Structure
- π§ Setup: Auto Submit and Move
- π§ Setup: Auto-Create Problem Set
- π§ Setup: Folding for Template Files
- π§ Setup: Auto CPH Judge with Competitive Companion
- Repository Purpose: This repository contains solutions to competitive programming problems, primarily from Kattis.
- Language Used: C++ and Python (could add this to CI/CD later)
- Auto-updated Statistics:
Note that the table below is auto-generated. There might be slight inaccuracies.
.github/workflows/
: Contains automation scripts for CI/CD.README.md
: Contains project description and auto-generated stats.
To automate Kattis submissions and organize accepted files:
-
Install Prerequisites:
- Python: Download Python
- Kattis CLI: Kattis CLI
- Python Packages:
pip install requests beautifulsoup4
- Ensure you have a valid
.kattisrc
file in your home directory with your credentials. You can get it from here.
-
Add
submit_and_move.py
:- The script is in
scripts/submit_and_move.py
.
- The script is in
-
Configure VSCode Task: Add this to
.vscode/tasks.json
:{ "version": "2.0.0", "tasks": [ { "label": "Submit to Kattis", "type": "shell", "command": "python", "args": ["${workspaceFolder}/scripts/submit_and_move.py", "${file}"], "presentation": { "echo": true, "reveal": "always", "focus": true, "panel": "shared", "showReuseMessage": false, "clear": false, "close": true }, "problemMatcher": [] } ] }
-
Setup Keybinding: Add to
keybindings.json
:[ { "key": "numpad0", "command": "workbench.action.tasks.runTask", "args": "Submit to Kattis", "when": "editorTextFocus" } ]
-
Create
solutions
Folder: Manually create the folder or the script will create it automatically. -
Submit Solution:
- Keep unfinished solutions in the root directory. Open the solution file (e.g.,
kattisexercise.cpp
), pressnumpad0
, and it will automatically upload the solution to Kattis. If accepted, the script moves the file to thesolutions
folder.
- Keep unfinished solutions in the root directory. Open the solution file (e.g.,
- Kattis CLI Documentation: Kattis CLI GitHub
Automate the creation of problem sets using Competitive Companion. You can add it as a Google Chrome extension from the Chrome Web Store here.
-
Install the Extension:
Download the Auto Region Folder extension. -
Configure Settings:
Add this to yoursettings.json
to enable import folding by default:"editor.foldingImportsByDefault": true
Now the template.cpp file will automatically fold the imports and core library definitions for a cleaner view.
-
Install Competitive Companion extension for Google Chrome.
-
Configure
settings.json
:"cph.general.defaultLanguage": "cpp", "cph.general.defaultLanguageTemplateFileLocation": "C:\\Users\\simon\\dev\\GitHub\\competetive-programming\\templates\\template.cpp"
-
Usage: Automatically fetch problems and use your custom C++ template.