Skip to content

CommunityOfCoders/CP-Workshop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 

Repository files navigation

CP-WORKSHOP

BASICS

Modular Arithmetic

// Addition
(a + b) % m = ((a % m) + (b % m)) % m

// Subraction
(a - b) % m = ((a % m) - (b % m)) % m

// Multiplication
(a * b) % m = ((a % m) * (b % m)) % m

// Division (We need to use Mod Inverse)
(a / b) % m != ((a % m) / (b % m)) % m
// Using Fermat's Little  theorem
// If m is prime
modInv(a, m) {
    return fastpow(a, m - 2, m);
    // pow(a, m - 2) % m
}
(a / b) % m = ((a % m) * modInv(b, m)) % m

TOPICS

Binary Search

Divide and Conquer

Disjoint Set Union (DSU)

Tries

Graphs

String Hashing (Rolling Hashing)

ADVANCED TOPICS

Dynammic Programming

Segment Tree

Tree DP

Polynomial Multiplication (FFT)

LCA (Binary Lifting)

RESOURCES

Youtube

Contests and Practice

Reading

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published