Hello fellow programmer! Welcome to the Awesome Competitive Programming Template GitHub repository. π This repository is your go-to destination for a comprehensive and handy competitive programming template written in C++. Whether you're a seasoned coder or just getting started, this template is designed to supercharge your problem-solving skills! π
- Introduction
- Getting Started
- π Macros
- π¦ Container Macros
- π Typedefs
- π Debug Utilities
- π Predefined Goodies
- Solving Problems
- β±οΈ Time Complexity
- Contributing
- License
Hey there, future coding champion! π Competitive programming is like a puzzle-solving adventure. π§© Our template is your trusty sidekick to tackle those algorithmic challenges head-on!
   Ideal Setup for Quick Run and Debug
  Ideal Setup for Quick Run and Debug
Excited to dive in? It's simple! Copy the amazing C++ code provided in this repository and paste it into your favorite C++ development environment or online compiler. VoilΓ ! You've got the power of the template at your fingertips. πͺ
   Add Test Case in Input File and Hit CTRL + R to Run
  Add Test Case in Input File and Hit CTRL + R to Run
- FastIO: Speed up your input/output operations with this magical macro.
- el: Say bye-bye to '\n'! Use this instead for a friendly newline.
- MOD1and- MOD2: Ready-to-use modular constants for those modulo calculations.
- INF: Your personal "infinity" for comparisons. π
- all(x): Wrangle your containers with ease, get the full range.
- rall(x): Reverse the fun! Go from end to start in a snap.
- popFront(x): Bye-bye first element! Remove it from your container.
- mp(x, y): Create a magical- pairwith values- xand- y.
- pb(x): Push- xinto your container (e.g., vector), like a pro.
- ppb(x): Pop the last element from your container, with flair.
- ll: Short for- long long int- your trusty big integer friend.
- ull: Say hi to- unsigned long long intfor all those positive vibes.
- lld: For precise calculations with a touch of decimal magic.
- vl: An abbreviation for- vector<ll>- your versatile list.
- vll: It's like- vl, but each element is a pair. Cool, right?
- pll: Say hello to- pair<ll, ll>- two values in one! π€
Noticed a pesky bug? π Our debug utilities come to the rescue! These helpful tools are only active when you're not on an online judge.
- debug(x): Peek into the value of- xduring debugging.
- _print(): A bunch of overloads to print various data types and containers.
- Operator overloads for input and output streams.
We've got some coding superpowers lined up for you:
We've got some coding superpowers lined up for you:
- GCD(a, b): The magical way to find the greatest common divisor of- aand- b. Learn more
- LCM(a, b): Compute the least common multiple of- aand- beffortlessly. Learn more
- pwr(a, b, mod): Ace the power of- araised to- b, modulo- mod. Learn more
- mminvprime(a, b): The modular multiplicative inverse of- aw.r.t. prime- b. Learn more
- modAdd,- modMul,- modSub,- modDiv: Modular arithmetic made simple! Learn more
- isPrime(n): Unlock the secret to checking if- nis prime. Learn more
Ready to conquer problems? Implement the solveMyProblem function. It reads from the input stream (in) and writes solutions to the output stream (out). All neatly wrapped in a test case loop!
void solveMyProblem(istream &cin, ostream &cout, ll testCase) {
    // Your brilliant solution goes here!
}Time is precious in competitive programming! Keep an eye on the time complexity of your solutions to ensure they're as efficient as can be.
Ready to add your magic touch? Feel free to contribute to this template or report any issues on our GitHub repository.
This project is licensed under the MIT License. So feel free to create, explore, and shine!
This amazing template was crafted with love by DocFlex. π
