Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iphelf/codeforcesstarterpack
This is a CMake project base for solving programming exercises (e.g. Codeforces).
https://github.com/iphelf/codeforcesstarterpack
automation cmake codeforces leetcode
Last synced: 20 days ago
JSON representation
This is a CMake project base for solving programming exercises (e.g. Codeforces).
- Host: GitHub
- URL: https://github.com/iphelf/codeforcesstarterpack
- Owner: iphelf
- License: mit
- Created: 2022-09-30T14:11:50.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-10-16T16:37:32.000Z (over 1 year ago)
- Last Synced: 2024-11-11T05:36:14.977Z (3 months ago)
- Topics: automation, cmake, codeforces, leetcode
- Language: Python
- Homepage:
- Size: 169 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Monorepo for programming exercises
## Usage
![Demo](doc/demo.png)
### 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
```or, directly use the executable produced by CMake, e.g. like this:
```shell
./build/Codeforces < ./source/in.txt
```### Managing
Manage your code with this directory structure:
- `source`: current working code
- `template`: template code
- `archive`: history codeAnd use `tool/archiver.py` to automate operations:
```shell
# 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)