From 4c15d8104ba9f5afe11464dc35da7f7a540a007f Mon Sep 17 00:00:00 2001 From: BrandonPacewic <92102436+BrandonPacewic@users.noreply.github.com> Date: Mon, 14 Apr 2025 14:43:48 -0700 Subject: [PATCH 1/3] docs(readme): project readme rewrite --- README.md | 105 +++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 100 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 281f7cb..73ba00b 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,104 @@ -# C++ Competitive Programming Library +

+

+ C++ Competitive Programming Library +

+

+ About • + Getting Started • + Milestones +

+

-A C++ template library designed for my own personal use in Competitive Programming Competitions. Each code snippet -from this repo, meaning individual functions and classes, are designed to be able to be used outside of this static -library environment. As Competitive Programming often involves submitting a single file this library needs to support -that. +## About + +This is my personal C++ library designed specifically for competitive programming. It contains a variety +of data structures, algorithms, and other utilities commonly used in competitive programming. Each component +of this library is designed to be drop-in-usable—no setup or external dependencies required. The entire +library is designed to have sections that are copy-pasteable into a single file for contest submission. + +## Getting Started + +Since the core idea of this library is to copy paste sections from it into your own code I recommend +having a local copy of the library in an easy to access location: + +```bash +git clone https://github.com/BrandonPacewic/CompetitiveProgramming +``` + +From there you can: + +1. Directly copy code from `cpl/inc` and `cpl/src` into your own code. +2. Include them locally in your own code for local practice. +3. Test against the provided test cases in `test/` for your own algorithm development. + +> [!NOTE] +> Additional instructions and support for importing the library and using the test cases is +> planed to be added in the future. + +## Milestones + +As will every single one of my projects, this is still very much a work in progress. The following is a list +of goals I have for this project before I'm truly happy with it, in no particular order: + +| # | Goal | Status | +| :-: | --------------------------------------------------------- | :----: | +| 1 | Refactor old code to match current standards | ⚠️ | +| 2 | Full test coverage | ⚠️ | +| 3 | Performance with supporting benchmarks | ⚠️ | +| 4 | Codebase Atomizer | ❌ | +| 5 | Full implementation of the CPH | ❌️ | + +A more detailed description of each goal can be found below: + +#### Refactor Old Code to Match Current Standards + +This is my longest standing project in terms of the initial creation date. As such, the earlier code does +not reflect my current standards. One of the current goals is to revise such code to improve quality. + +> [!WARNINg] +> I find the structure of the code in this repository to be quite volatile. I have probably re-written some +> of the algorithms 10+ times. If something doesn't look quite right, it probably isn't. + +#### Full Test Coverage + +While this library is designed to be used in competitive programming, where tests written in this repository +obviously won't be carried over. There still should be total test coverage this includes copies of various +programming problems that I have used sections of this library to solve. + +#### Performance with Supporting Benchmarks + +In the spirit of competitive programming, while solving the problem is the main goal, performance is also +a key component. Benchmarks should back up various design decisions when it comes to how I have chosen to +structure and implement various key algorithms and data structures. + +> [!NOTE] +> While I do want 100% test coverage, I'm less concerned about benchmarks. Benchmarks will be added +> as I find them necessary to support design decisions. + +#### Codebase Atomizer + +The *Atomizer* is a tool used to break down the codebase into smaller, more manageable pieces, that can be +retrieved quickly. For example, if you want to use a specific function, say `output_container` to keep things +simple. You can use the *Atomizer* output to retrieve that specific function via a file lookup, `output_container.cpp`. +You can also use any supporting tool you want to pase that file buffer directly inline into your code. Rather than +opening the container header file and copying the specific lines from the file that you need. This will also work +with more complex algorithms that may require an additional data structure to function. For example, if you want to +use Kruskal's algorithm, you can use the *Atomizer* to retrieve the `kruskal.cpp` file which will include the +supporting `DisjointSet` class used within the algorithm. Again resolving you of finding the specific lines of code +within the header file that you need. + +#### Full Implementation of the CPH (Competitive Programming Handbook) + +The [*Competitive Programming Handbook*]() by Antti Laaksonen is a awesome, all in one, resource for +everything competitive programming. It contains everything from compiling and reading input to sweep line +algorithms including convex hulls. Its an eventual goal of mine to fully implement all the algorithms outlined +in the book. This has the added benefit of an *complete* documentation source of all the algorithms in this +library. This is a long term goal and will likely take a while to complete. + +> [!NOTE] +> This is my end game goal for this project. When its completed I will consider this project *done* as so far +> as it will no longer be a major work in progress for me personally. I will still add things here and there +> and work on it when I'm compelled to do so but the core goals of this project will be officially complete. ## License From d983fdbb7a6cef60d652a5b67ef4537ded3d828b Mon Sep 17 00:00:00 2001 From: BrandonPacewic <92102436+BrandonPacewic@users.noreply.github.com> Date: Mon, 14 Apr 2025 14:55:56 -0700 Subject: [PATCH 2/3] fix(readme): general readme fixes --- README.md | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 73ba00b..9e97ca5 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@

AboutGetting Started • - Milestones + Milestones

@@ -13,13 +13,13 @@ This is my personal C++ library designed specifically for competitive programming. It contains a variety of data structures, algorithms, and other utilities commonly used in competitive programming. Each component -of this library is designed to be drop-in-usable—no setup or external dependencies required. The entire +of this library is designed to be drop-in usable—no setup or external dependencies required. The entire library is designed to have sections that are copy-pasteable into a single file for contest submission. ## Getting Started -Since the core idea of this library is to copy paste sections from it into your own code I recommend -having a local copy of the library in an easy to access location: +Since the core idea of this library is to copy-paste sections from it into your own code I recommend +keeping a local copy of the library in an easy to access location: ```bash git clone https://github.com/BrandonPacewic/CompetitiveProgramming @@ -33,12 +33,12 @@ From there you can: > [!NOTE] > Additional instructions and support for importing the library and using the test cases is -> planed to be added in the future. +> planned to be added in the future. ## Milestones -As will every single one of my projects, this is still very much a work in progress. The following is a list -of goals I have for this project before I'm truly happy with it, in no particular order: +As with every single one of my projects, this is still very much a work in progress. The following is a list +of goals I have for this project before I consider it to be complete, in no particular order: | # | Goal | Status | | :-: | --------------------------------------------------------- | :----: | @@ -55,15 +55,15 @@ A more detailed description of each goal can be found below: This is my longest standing project in terms of the initial creation date. As such, the earlier code does not reflect my current standards. One of the current goals is to revise such code to improve quality. -> [!WARNINg] +> [!NOTE] > I find the structure of the code in this repository to be quite volatile. I have probably re-written some -> of the algorithms 10+ times. If something doesn't look quite right, it probably isn't. +> of the algorithms 10+ times as this library tends to evolve as I become a better programmer. +> If something doesn't look quite right, it probably isn't. #### Full Test Coverage -While this library is designed to be used in competitive programming, where tests written in this repository -obviously won't be carried over. There still should be total test coverage this includes copies of various -programming problems that I have used sections of this library to solve. +While this library is meant for competitive programming (where tests don’t carry over), it should still have +full test coverage — including tests derived from problems where I used components of this library to solve them. #### Performance with Supporting Benchmarks @@ -80,23 +80,23 @@ structure and implement various key algorithms and data structures. The *Atomizer* is a tool used to break down the codebase into smaller, more manageable pieces, that can be retrieved quickly. For example, if you want to use a specific function, say `output_container` to keep things simple. You can use the *Atomizer* output to retrieve that specific function via a file lookup, `output_container.cpp`. -You can also use any supporting tool you want to pase that file buffer directly inline into your code. Rather than +You can also use any supporting tool you want to paste that file buffer directly inline into your code. Rather than opening the container header file and copying the specific lines from the file that you need. This will also work with more complex algorithms that may require an additional data structure to function. For example, if you want to use Kruskal's algorithm, you can use the *Atomizer* to retrieve the `kruskal.cpp` file which will include the -supporting `DisjointSet` class used within the algorithm. Again resolving you of finding the specific lines of code +supporting `DisjointSet` class used within the algorithm. Again saving you from finding the specific lines of code within the header file that you need. #### Full Implementation of the CPH (Competitive Programming Handbook) -The [*Competitive Programming Handbook*]() by Antti Laaksonen is a awesome, all in one, resource for -everything competitive programming. It contains everything from compiling and reading input to sweep line +The [*Competitive Programming Handbook*](https://cses.fi/book/book.pdf) by Antti Laaksonen is an awesome, all in one, +resource for everything competitive programming. It contains everything from compiling and reading input to sweep line algorithms including convex hulls. Its an eventual goal of mine to fully implement all the algorithms outlined in the book. This has the added benefit of an *complete* documentation source of all the algorithms in this library. This is a long term goal and will likely take a while to complete. > [!NOTE] -> This is my end game goal for this project. When its completed I will consider this project *done* as so far +> This is my endgame for this project. When its completed I will consider this project *done* as so far > as it will no longer be a major work in progress for me personally. I will still add things here and there > and work on it when I'm compelled to do so but the core goals of this project will be officially complete. From 32ee258f4e36046ce8bece80feb9773a3f54f42e Mon Sep 17 00:00:00 2001 From: BrandonPacewic <92102436+BrandonPacewic@users.noreply.github.com> Date: Mon, 14 Apr 2025 14:57:37 -0700 Subject: [PATCH 3/3] fix(readme): change nested title size --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 9e97ca5..7847ef2 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ of goals I have for this project before I consider it to be complete, in no part A more detailed description of each goal can be found below: -#### Refactor Old Code to Match Current Standards +### Refactor Old Code to Match Current Standards This is my longest standing project in terms of the initial creation date. As such, the earlier code does not reflect my current standards. One of the current goals is to revise such code to improve quality. @@ -60,12 +60,12 @@ not reflect my current standards. One of the current goals is to revise such cod > of the algorithms 10+ times as this library tends to evolve as I become a better programmer. > If something doesn't look quite right, it probably isn't. -#### Full Test Coverage +### Full Test Coverage While this library is meant for competitive programming (where tests don’t carry over), it should still have full test coverage — including tests derived from problems where I used components of this library to solve them. -#### Performance with Supporting Benchmarks +### Performance with Supporting Benchmarks In the spirit of competitive programming, while solving the problem is the main goal, performance is also a key component. Benchmarks should back up various design decisions when it comes to how I have chosen to @@ -75,7 +75,7 @@ structure and implement various key algorithms and data structures. > While I do want 100% test coverage, I'm less concerned about benchmarks. Benchmarks will be added > as I find them necessary to support design decisions. -#### Codebase Atomizer +### Codebase Atomizer The *Atomizer* is a tool used to break down the codebase into smaller, more manageable pieces, that can be retrieved quickly. For example, if you want to use a specific function, say `output_container` to keep things @@ -87,7 +87,7 @@ use Kruskal's algorithm, you can use the *Atomizer* to retrieve the `kruskal.cpp supporting `DisjointSet` class used within the algorithm. Again saving you from finding the specific lines of code within the header file that you need. -#### Full Implementation of the CPH (Competitive Programming Handbook) +### Full Implementation of the CPH (Competitive Programming Handbook) The [*Competitive Programming Handbook*](https://cses.fi/book/book.pdf) by Antti Laaksonen is an awesome, all in one, resource for everything competitive programming. It contains everything from compiling and reading input to sweep line