iphelf / CodeforcesStarterPack

This is a CMake project base for solving programming exercises (e.g. Codeforces).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Monorepo for programming exercises

Usage

Demo

Coding

Code under source directory.

Test your code against the test case (in.txt and oracle.txt) with CTest:

ctest --output-on-failure

or, use tool/tester.py directly:

./tool/tester.py <executable> <input file> <oracle file>

or, directly use the executable produced by CMake, e.g. like this:

./build/Codeforces < ./source/in.txt

Managing

Manage your code with this directory structure:

  • source: current working code
  • template: template code
  • archive: history code

And use tool/archiver.py to automate operations:

# To backup `source` to `archive`:
./tool/archiver.py backup

# To restore from some directory under `archive`:
./tool/archiver.py restore

# To reset `source` with `template`
./tool/archiver.py reset

# To backup `source` to `archive` and then reset `source` with `template`
./tool/archiver.py archive

Note: use archiver.ini or command line arguments to specify paths.

Example

Here is the process of a typical use case:

  1. Set archive=archive/Codeforces/E136 in archive.ini
  2. For each problem P in {A, B, C, D}:
    1. Copy sample input and output to source/in.txt and source/oracle.txt
    2. Solve the problem in source/main.cpp
    3. Archive source to a subdirectory under archive/Codeforces/E136/ by ./tool/archiver.py archive (the tool will interactively ask for the problem ID, and use it to name the subdirectory)

About

This is a CMake project base for solving programming exercises (e.g. Codeforces).

License:MIT License


Languages

Language:Python 88.4%Language:CMake 7.0%Language:C++ 4.6%