Fast Olympic Coding is an extension to assist with various tasks in competitive programming. It is a ported and enhanced version of the corresponding Sublime Text plugin that also leverages the power of VSCode.
- 📜 Concurrently run, edit, and delete multiple testcases
- 👨🏻💻 Stress tester to find counterexamples
- 👜 Insert pre-written code from another file with automatic folding
- 🛜 Reads contests and problems from Competitive Companion
- 🏃 BLAZINGLY FAST! Asynchronous design + optimizations = 99% spam proof!
- Compile (if file has compile command and file had changed) and run all testcases:
Ctrl+Alt+B
- Stop all testcases:
Ctrl+Alt+K
- Delete all testcases:
Ctrl+Alt+D
- Run stress test:
Ctrl+Alt+G
- Insert file template:
Ctrl+Alt+I
📥 Install within VSCode or at Visual Studio Marketplace
Provide run settings for the languages you use in settings.json
. Here are some examples for C++, Python, and Java:
{
"fastolympiccoding.runSettings": {
".cpp": {
"compileCommand": "g++ -std=gnu++20 -D_GLIBCXX_DEBUG ${path:${file}} -o ${path:${fileDirname}/${fileBasenameNoExtension}${exeExtname}}",
"runCommand": "${path:${fileDirname}/${fileBasenameNoExtension}${exeExtname}}"
},
".py": {
"runCommand": "python ${path:${file}}"
},
".java": {
"compileCommand": "javac ${path:${file}}",
"runCommand": "java -cp ${fileDirname} ${fileBasenameNoExtension}"
}
}
}
We can use the following variables in the syntax of ${...}
- Most of VSCode's built-in variables
${exeExtname}
returns.exe
for Windows and an empty string for other platforms${path:*value*}
normalizes *value* into a valid path string for the current platform
Settings per language
compileCommand
(optional): Command to run beforerunCommand
when the file content changedrunCommand
: Command to run the solutioncurrentWorkingDirectory
(optional): sets the current working directory forrunCommand
- Show/hide the testcase details
- Shortened details of testcases for huge outputs
- View full text by clicking on their corresponding arrows
- Color supported output for compile errors
- ... and so much more!
View wrong answers in a diff view! |
General setting for both Testcase Window and Stress Tester
font
: Font family used to render text (restart extension to apply)runSettings
: Object of run settingsmaxDisplayCharacters
: Maximum number of characters to display for each outputmaxDisplayLines
: Maximum number of lines to display for each output
Required files (naming scheme can be configured in settings):
<name>.[ext]
: the solution to bruteforce against<name>__Good.[ext]
: the solution that outputs the correct answer<name>__Generator.[ext]
: to generate inputs for the other 2 files- The extension provides a 64-bit integer seed input for random number generators!
Stress Tester was able to find an counterexample due to an integer overflow bug! |
Settings for Stress Tester
goodSolutionFile
: Full path for good solution file (supports${...}
)generatorFile
: Full path for generator file (supports${...}
)delayBetweenTestcases
: Amount of delay between generated testcases in milliseconds (minimum:5
)maxRuntime
: Maximum time in milliseconds the Stress Tester is allowed to spend on one testcase (-1
for no limit)
- Add the root directory of the templates to the settings
- Remove trailing newlines for fold to work (folding is optional via settings)
Adding a tree reroot DP template without switching files |
Possible settings
fileTemplatesBaseDirectory
: Full path to the base directory of all prewritten files (supports${...}
)foldFileTemplate
(default:false
): Whether to fold the newly inserted prewritten code
- Open the extension to start the listening process!
Using Competitive Companion to parse a CodeForces problem |
We can parse an entire CodeForces Div.3 Contest! |
Settings for Competitive Companion integration
openSelectedFiles
(default:true
): Whether to open all the selected filesaskForWhichFile
(default:false
): Ask for which file to write testcase onto, even when a file is currently opened and only a single problem has been receivedincludePattern
(default:**/*
): Glob pattern to filter in the included files for asking promptexcludePattern
(default: empty): Glob pattern to filter out the included files for asking prompt
- FastOlympicCoding: The original Sublime Text package that inspired this extension 💖
- Flaticon: Icon for this extension 💖