cpbooster can clone a contest to your computer with the following command:
This command does 5 things:
- Waits for competitive companion extension to send the data from the contest.
- Creates a folder inside your contests directory with the same name as the contest that you are cloning.
- Creates source files for all the problems in the contest. Using the name of the corresponding problem as file name.
- Loads the template that corresponds to your preferred language to each source file.
- Downloads test cases as
.ansfiles. Using the name of the corresponging problem as file name as well.
ls in the contest directory will show you something like the following.
The first thing to notice is that every file that corresponds to the
X problem has the same name as
except for the extension. This is how
cpbooster identifies which testcases correspond to a certain source file.
This means that you could create a new test case attached to the problem
just by creating the corresponding
cpbooster has a way to automate this task. See Add Test Case. The same applies for executable files,
they will use the same name except for the extension, which will be
The second thing to notice is that there are no subfolders!, the file structure is flat!, which is just amazing for several reasons. See Why Flat File Structure? to know more.
There are several reasons why a flat file structure is preferred when it comes to competitive programming constests.
But definitely the main reason, is because we want speed!, being fast in a contest is crucial.
For example, having to change the directory like this
each time you switch to another problem is just so annoying and slow.
to open all your source files.
or let's say you want to see or modify the contents of some test case, you could just do
to open the file, without changing the directory or using long relative paths.
or imagine the situation where for some reason you just want to run your code with any of the available test cases manually
cpbooster), due to the fact that you will have a flat file structure you will be able to do it
without changing the directory or using long relative paths. Just
./Program.exe < Program.in1 or
python Program.py < Program.in1, etc.
This simplicity will also allow you to use
cpbooster with any source file you already have, not just for cloned contests.
Also, do not forget that folders do use space, even when they are empty, Why would you like to use more space just for a competitive programming contest ???