CPLib is the abbreviation of Competitive Programming Library.

Related tags

Miscellaneouscplib
Overview

CPLib

CPLib is the abbreviation of Competitive Programming Library. It aims to be a general template and optimization library for competitive programming.

The idea is similar to cLay, but I hope it to be easier to maintain, having less hard-coded rules, and C++ compatible. Also, I want to implement some optimizations, such as loop-blocking/unrolling, auto SIMD, etc. on the source code level.

Templates proposal

General templates are not implemented yet. I want to implement in cLay like formats (see https://codeforces.com/contest/1556/submission/127359517 for example).

I hope the templates can use global arrays (for example, the array in segment tree) instead of struct members. Also, I want to use global functions as callback functions (for example, the maintain function in segment tree). If we use std::function or function pointers, the running speed depends on how smart is the compiler.

To pass these arguments into the templates, I think pragmas is a good idea (see the modint part below for more information).

Implemented packages

Currently there are very few implemented packages.

math.modint

This package implements a typical modint template. It allows common operations, but it's more efficient.

It traversals each expression, computes the possible min/max of them, and finds a method which has mininum number of modulo.

See examples/modint/ for examples.

util.inline

This package can inline functions on source code level. Add #pragma cplib inline in front of your function, every call will be inline.

See examples/inline/ for examples.

util.minimize

This package tries to minimize the code. However, it only detects repeating segments, and replace them using macro definitions.

Usage

Download Clava at https://github.com/specs-feup/clava, and fill the path into src/config.py.

Install python packages from src/requirements.txt.

Then you can run python src/compile.py input.cpp -o output.cpp to "compile" files.

You need to add include to your IDE's include paths to make IDE happy.

To include a package, use #include "cplib/xxx/xxx.hpp" or #pragma cplib use xxx.xxx.

Others

If you have some ideas about the template proposals, or the project, please open issues.

This project is very immature, and needs a lot of time to develop, welcome for your contribute.

Clava runs very slow (~5s on my computer for a regular source code), if there is better replacement, please tell me!

Create or join a private chatroom without any third-party middlemen in less than 30 seconds, available through an AES encrypted password protected link.

PY-CHAT Create or join a private chatroom without any third-party middlemen in less than 30 seconds, available through an AES encrypted password prote

1 Nov 24, 2021
High-level bindings to the Valhalla framework.

Valhalla for Python This spin-off project simply offers improved Python bindings to the fantastic Valhalla project. Installation pip install valhalla

GIS • OPS 20 Dec 13, 2022
A python program with an Objective-C GUI for building and booting OpenCore on both legacy and modern Macs

A python program with an Objective-C GUI for building and booting OpenCore on both legacy and modern Macs, see our in-depth Guide for more information.

dortania 4.7k Jan 02, 2023
Notifies server owners of mod updates, also notifies of player deaths and player joins through Discord.

ProjectZomboid-ServerAssistant Notifies server owners of mod updates, also notifies of player deaths and player joins through Discord. A Python based

3 Sep 30, 2022
Another Provably Rare Gem Miner 💎 (for Raritygems)

Provably Rare Gem Miner Go (for Rarity) Pull Request is strongly welcome as I don't know anything about Golang/Python/Web3. Usage Install Python 3.x i

朱里 6 Apr 22, 2022
Streamlit apps done following data professor's course on YouTube

streamlit-twelve-apps Streamlit apps done following data professor's course on YouTube Español Curso de apps de data science hecho por Data Professor

Federico Bravin 1 Jan 10, 2022
A Python 3 client for the beanstalkd work queue

Greenstalk Greenstalk is a small and unopinionated Python client library for communicating with the beanstalkd work queue. The API provided mostly map

Justin Mayhew 67 Dec 08, 2022
Bots in moderation and a game (for now)

Tutorial: come far funzionare il bot e durarlo per 24/7 (o quasi...) Ci sono 17 passi per seguire: Andare sul sito Replit https://replit.com/ Vedrete

ZacyKing 1 Dec 27, 2021
Removes all archived super productivity tasks. Just run the python script.

delete-archived-sp-tasks.py Removes all archived super productivity tasks. Just run the python script. This is helpful to do a cleanup every 3-6 month

Ben Herbst 1 Jan 09, 2022
A python package that computes an optimal motion plan for approaching a red light

redlight_approach redlight_approach is a Python package that computes an optimal motion plan during traffic light approach. RLA_demo.mov Given the par

Jonathan Roy 4 Oct 27, 2022
Intelligent Employer Profiling Platform.

Intelligent Employer Profiling Platform Setup Instructions Generating Model Data Ensure that Python 3.9+ and pip is installed. Install project depende

Harvey Donnelly 2 Jan 09, 2022
Airflow Operator for running Soda SQL scans

Airflow Operator for running Soda SQL scans

Todd de Quincey 7 Oct 18, 2022
Defichain maxi - Scripts to optimize performance on defichain rewards

defichain_maxi This script is made to optimize your defichain vault rewards by m

kuegi 75 Dec 31, 2022
Automatically deletes Capital One Eno virtual cards for when you've made a couple too many.

eno-delete Automatically deletes Capital One Eno virtual cards for when you've made a couple too many. Warning: Program will delete ALL virtual cards

h3x 3 Sep 29, 2022
A password genarator/manager for passwords uesing a pseudorandom number genarator

pseudorandom-password-genarator a password genarator/manager for passwords uesing a pseudorandom number genarator when you give the program a word eg

1 Nov 18, 2021
A collection of common regular expressions bundled with an easy to use interface.

CommonRegex Find all times, dates, links, phone numbers, emails, ip addresses, prices, hex colors, and credit card numbers in a string. We did the har

Madison May 1.5k Dec 31, 2022
Live tracking, flight database and competition framework

SkyLines SkyLines is a web platform where pilots can share their flights with others after, or even during flight via live tracking. SkyLines is a sor

SkyLines 367 Dec 27, 2022
Vaksina - Vaksina COVID QR Validation Checker With Python

Vaksina COVID QR Validation Checker Vaksina is a general purpose library intende

Michael Casadevall 33 Aug 20, 2022
Devil - Very Semple Auto Filter V1 Bot

Devil Very Semple Auto Filter V1 Bot

2 Jun 27, 2022