# CPP Competitive Programming Snippets

Sublime Snippets for improving the coding experience while doing competitive programming in C++.

## Details

## Installs

- Total 6K
- Win 4K
- Mac 550
- Linux 1K

May 18 | May 17 | May 16 | May 15 | May 14 | May 13 | May 12 | May 11 | May 10 | May 9 | May 8 | May 7 | May 6 | May 5 | May 4 | May 3 | May 2 | May 1 | Apr 30 | Apr 29 | Apr 28 | Apr 27 | Apr 26 | Apr 25 | Apr 24 | Apr 23 | Apr 22 | Apr 21 | Apr 20 | Apr 19 | Apr 18 | Apr 17 | Apr 16 | Apr 15 | Apr 14 | Apr 13 | Apr 12 | Apr 11 | Apr 10 | Apr 9 | Apr 8 | Apr 7 | Apr 6 | Apr 5 | Apr 4 | Apr 3 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|

Windows | 0 | 3 | 1 | 5 | 2 | 0 | 4 | 4 | 6 | 4 | 1 | 5 | 1 | 1 | 6 | 1 | 4 | 1 | 2 | 2 | 0 | 3 | 5 | 4 | 0 | 4 | 4 | 3 | 4 | 5 | 1 | 4 | 4 | 5 | 1 | 1 | 2 | 3 | 3 | 5 | 3 | 7 | 3 | 2 | 3 | 1 |

Mac | 0 | 1 | 2 | 0 | 1 | 1 | 0 | 1 | 0 | 3 | 0 | 2 | 2 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 2 | 0 | 1 | 1 | 0 | 1 | 0 | 2 | 1 | 0 | 2 | 1 | 1 | 0 | 0 | 0 | 2 | 0 | 0 | 1 | 0 | 0 | 1 |

Linux | 0 | 1 | 0 | 1 | 2 | 0 | 0 | 0 | 1 | 0 | 2 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 1 | 1 | 1 | 2 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 2 | 1 | 1 | 1 | 0 | 2 | 0 | 0 | 2 |

## Readme

- Source
- raw.githubusercontent.com

A collection of code snippets for competitive programmers, written in C++ for sublime editor.

Many times this happens in competitive programming competitions that you've figured out an algorithm for the solution of the problem, which happens to be a standard algorithm. How helpful would it be to have snippets for commonly used concepts/algorithms in competitive programming in that situation, to provide you an edge over fellow competitors as using snippets will improve your accuracy, speed and hence rank!

This repository provides extension for sublime-text editor which enables sublime users to use c++ coding snippets of algorithms while doing competitive programming.

## Installation

Install using Package Control : Sublime Package manager:

- Ctrl + Shift + P will open command palette
- Type and Select Package Control : Install Package
- Search for Competitive programming sublime snippets and hit enter

## Usage

Following table contains all the snippets available in this package. It gives information about the file containing the code of a particular snippet, prompt of the snippet, and when to use that particular snippet.

File Name |
Prompt |
When to use |
---|---|---|

codeChefStarter.cpp | codechef | Starting template for all the codechef problems |

codeJamStarter.cpp | codejam | Starting template for all the codejam problems |

codeChefStarterPython.py | codechef-py | Starting template for all the codechef problems in python |

time.cpp | time | To calculate time taken by a particular code to run |

basicGeometry.cpp | geometry-basic | In geometry problems, you'll need cartesian-points, distance between points and things like these. |

convexHull.cpp | convex-hull | To get vector of points belonging to hull in anti-clockwise order |

polygonArea.cpp | polygon-area | Find Area of a polygon whose points are given |

dfs.cpp | dfs | Depth First Search Algorithm |

dsu.cpp | dsu | Disjoint Set Union |

ewalk.cpp | ewalk | Euler Walk |

graphStarter.cpp | graph-starter | Starting template for all the graph problems |

minHeap.cpp | min-heap | min-heap using c++ stl |

maxHeap.cpp | max-heap | max-heap using c++ stl |

bigInt.cpp | bigint | BigInt in c++ |

binomialBigMod.cpp | binomial-big-mod | nCr % m:O(nlog(no. of digits in n)), n<m finds nCr for all 0<=r<=n in fact vector Modular Division - Euclid Extended theorem |

binomialSmallMod.cpp | binomial-small-mod | nCr % m:O(m^{2logn),} N is greater than m. (m is small) Lucas theorem |

2dSegmentTree.cpp | 2d-segment-tree | 2-D Segment Tree for Range Queries in 2-D |

simpleSegmentTree.cpp | segment-tree | Classic Segment Tree |

splitString.cpp | split-string | Split a c++ string by a delimiter |

suffixArray.cpp | suffix-array | Suffix array and LCP array |

binarySearch.cpp | binary-search | Binary Search |