Competitive Programming Assistant for Rust.
I drew inspiration from the JHelper plugin for CLion, but I made Polycarp a regular Rust repository that is not bound to any IDE.
With Polycarp, you can listen to parsed tasks from Competitive Assistant browser extension and generate tests with ease. All you need is to implement a single function, and you're good to go! Additionally, I included a library with commonly used algorithms, so you don't have to write the same code repeatedly.
If you encounter any issues or have feedback, feel free to report them on the GitHub page.
Discussion at Codeforces Blogs.
- Install Competitive Companion: firefox, chrome.
- Start Polycarp service in a separate terminal:
cargo run --bin polycarp
. - Navigate to the problem web page (example).
- Click
+
icon to parse the problem. - Now unimplemented solution and tests are generated in solve.rs.
- Run tests using
cargo test --bin submission
. - Implement
fn solve
in solve.rs. - Generate submission.rs using
cargo run --bin finalizer
. - Upload submission.rs to e-judge (example).
example.mp4
There is a library module that provides most frequently used primitives for competitive programming.
For example if you add
use library::ordering;
then you can use it in solve.rs:
fn solve() {
// ...
vec.sort_by(ordering::reverse);
}
and when generating a submission.rs, the above import will be expanded to
mod ordering {
pub fn reverse<T: core::cmp::Ord>(a: &T, b: &T) -> core::cmp::Ordering {
b.cmp(a)
}
}
This way user can just clone this repo and start competing without any additional setup.
When a new problem is parsed, then previous solve.rs is copied to history directory (which is
added to .gitignore
).