As a personal initiative to elevate the standard of our local competitions, I have designed this repository to offer a complete suite needed for the Olympiad. Inside, you will not only find my own and example solutions, but also a comprehensive set of test cases for each.
To tie it all together, I have built a fabulous autograder that automates the testing process (which saved many man-hours), giving immediate feedback just like a real contest environment.
Thankfully, the Olympiad took place on December 13th, and I hope everyone enjoyed the new experience.
The system is built on two scripts working together:
- The Manager (
grade.sh): This is the main script you interact with. It sets up the scoreboard and manages the batch. - The Worker (
autograder.sh): The Manager calls this worker script for every problem. The worker compiles the code, runs it against every input file in the test folder, and reports the score back to the Manager.
First, download this repository and make sure the scripts are allowed to run:
git clone https://github.com/maximbenea/oli-2025
cd oli-2025
chmod +x grade_all.sh autograder.shEnsure your folder looks something like this. You need your solution file and a folder containing the test cases (input*.in and output*.out) for that problem
.
├── grade.sh <-- The Manager
├── autograder.sh <-- The Worker
├── solution.cpp <-- Your code
└── tests/ <-- Test case folder
├── input1.in
└── output1.out
The command syntax is:
./grade_all.sh <Language> <Count> <File> <Test_Folder>Example: Grading 1 C++ Problem
./grade_all.sh cpp 1 solution.cpp testsExample: Grading 2 Problems (Batch Mode)
./grade_all.sh cpp 2 problem1.cpp tests1 problem2.cpp tests2PASSED: Your output matched the reference exactly.
FAILED: The script will display your output vs. the expected output so you can debug.
Summary: A final table will appear at the end showing your score for all problems.