Maximum Number of Points in a Line
Resources:
wikipedia.org ==>> Collinearity
GFG
How To Determine If Points Are Collinear In Coordinate Geometry?
Collinear
Maximum Number of Points in a Line
Implementation basis Spoj & Codechef problem:
A* search algorithm
Resources:
wikipedia.org ==> A*_search_algorithm
hackerearth blog
GFG
stanford.edu
hackerrank Problems
implementation from Youtube Video:
Expression parsing
Resources:
Cp_Algorothm
Problem Link:
1309 - Children`s Math
1324 - Equivalent Boolean Expressions
Implementation:
1118 - Incredible Molecules
Problem link: 1118 - Incredible Molecules
Topic: Geometry
Resources:
Robert Eisele
Matrix.Code
Code:
Floyd-Warshall Algorithm
Resources:
গ্রাফ থিওরিতে হাতেখড়ি ১০: ফ্লয়েড ওয়ার্শল
CP-Algorithms
ইকরাম মাহমুদ
smilitude
Implementation:
Problems:
B. Greg and Graph
Z Algorithm
Resources:
tushar roy
Z-function and its calculation
Shakil Ahmed (bangla blog)
Animation
Linear-time pattern matching. Z-values and Z-algorithm
Finish of Linear-time pattern matching
Z Algorithm ( HackerEarth)
GeeksforGeeks
Ivan Yurchenko blog
Implematation:
Problems:
E-maxx blog
hackerEarth
string algo
2015 ACM Amman Collegiate Programming Contest ( H.Bridge)
Problem link: H. Bridges
Idea:
First, find all bridges in the given graph, then remove them from the graph and find all components of the resulting graph.
Consider each component as a single vertex and add the bridges again, now you have a tree where all edges are bridges (in the original graph).
In the resulting tree, to make an edge not a bridge, it has to be in a cycle, and since all edges in this cycle won't become bridges anymore, you have to create the largest possible cycle, so find the longest path in the tree, and connect it's endpoints. Final answer is : Total number of bridges — length of resulting cycle + 1
Which is equal to : Total number of bridges — longest path in tree.
Hashing
Resources:
Threads @ IIIT Hyderabad
Palindrome Substring Queries
Palindrome Substring Queries Implementation
CF blog
CF blog
E-maxx
uniqeSubstring Implementation
group identical implementation
Problems:
Substring Search
1517. Freedom of Choice
ADAPHOTO - Ada and Terramorphing
Minimal Shift
Cyclic Shifts
Sub-palindromes
Manacher's Algorithm
Strings - 3
Suffixes
Jitu and Strings
A2 online
H. Queries for Number of Palindromes
Implementation:
RabinKarp
Resource:
Tushar Roy
Abdul Bari
GeeksForGeeks
E-maxx
Implementation:
Problems:
NAJPF - Pattern Find SOLUTION
D. Good Substrings
D. Palindromic characteristics
Lowest Common Ancestor
Resource:
লোয়েস্ট কমন অ্যানসেস্টর
Lowest Common Ancestor, Binary Lifting and HLD
copsiitbhu.co.in
Lowest Common Ancestor - O(N−−√) and O(logN) with O(N) preprocessing
Lowest Common Ancestor - Binary Lifting
Lowest Common Ancestor - Farach-Colton and Bender Algorithm
Solve RMQ (Range Minimum Query) by finding LCA (Lowest Common Ancestor)
Lowest Common Ancestor - Tarjan's off-line algorithm
topcoder
Lowest Common Ancestor
CF
Lowest Common Ancestor in a Binary Search Tree.
[Tutorial] Searching Binary Indexed Tree in O(log(N)) using Binary Lifting
CF blog
Youtube Video:
Gaurav Sen
Rachit jain
TusharRoy
Algorithms Live
ACM Advanced Training 2018 - Lecture 2-2 - LCA and Sparse Table
Problem:
Problems
LCA problems
Codechef
E-maxx blog problem list
LCA SOLUTION
Code:
Longest Increasing Subsequence (LIS)
Resource:
Longest Increasing Subsequence (GFG)
LIS and variation
ডাইনামিক প্রোগ্রামিং এ হাতেখড়ি-৪
Problem:
990 - Diving for Gold
1501. Sense of Beauty
1167. Bicolored Horses
231 - Testing the CATCHER
10926 - How Many Dependencies?
10000 - Longest Paths
XMEN SOLUTTION
10635 - Prince and Princess
1277 - Looking for a Subsequence SOLUTION
Code:
Treap (Cartesian tree)
Resources:
E-maxx
Algorithms Thread Episode 9: Treaps
carpanese blog
quora-Part-1 Part 2
Cf blog 0
CF Blog 1
CF blog 2
Cf blog 3
Cf blog 4
ACM Cairo Science
Youtube:
2.5+ hours lecture
Algorithm Live
Implementation:
Sqrt Decomposition
Resoures:
E-Maxx
Shafayet blog
Rezwan's CP Blog
Anudip blog
Tanvir's Blog
MO'S Algo
One problem-solution discussion 2D SQRT
MO’s Algorithm (Query square root decomposition)
Mo's algorithm (HackerEarth)
GeeksForGeeks
CF blog: 1 2
Cf blog3
CF blog4
[Tutorial] Two ways to apply Mo's Algorithm on Trees
Mo's Algorithm on Trees [Tutorial]
Practice Problem
Practice Contest
Youtube:
Rachit Jain
Gaurav sen
SolverToBe
Santo vai video
Implementation:
Implementation:
0/1 KnapSack
Resources:
GeeksForGeeks
HackerEarth
Codeforces
CF blog
Code:
Code: (When Knapsack size is large)
ProblemList:
B. Checkout Assistant
UVA
A2Online Judge
E-maxx training part - 04
Minimum stack / Minimum queue
Implementation
Sparse Table
RMQSQ - Range Minimum Query SOLUTION
THRBL - Catapult that ball
Matchsticks
Sereja and D
D. CGCDSSQ
D. R2D2 and Droid Army
B. Maximum of Maximums of Minimums
TNVFC1M - Miraculous
DCP-19: Multiplication Interval
D. Animals and Puzzle
E. Trains and Statistic
POSTERIN - Postering
RPLN - Negative Score
CITY2 - A Famous City
DIFERENC - DIFERENCIJA
E. Turn Off The TV
D. Map
E. Awards For Contestants
C. Longest Regular Bracket Sequence
Disjoint Set Union
1671. Anansi's Cobweb
D. Roads not only in Berland
1003. Parity
CHAIN - Strange Food Chain
CLFLARR - COLORFUL ARRAY
Fenwick Tree
12086 - Potentiometers
1112 - Curious Robin Hood
1266 - Points in Rectangle
Gravel
CTRICK - Card Trick
MATSUM - Matrix Summation
DQUERY - D-query
NKTEAM - Team Selection
YODANESS - Yodaness Level
SRM 310 - FloatingMedian
ADABEHIVE - Ada and Behives
Counting In Byteland
DCP-300: Shan and String
E. Little Artem and Time Machine
E. Hanoi Factory
TULIPNUM - Tulip And Numbers
SUMSUM - Enjoy Sum with Operations
SGIFT - Sabbir and gifts
TPGA - The Permutation Game Again
ZIGZAG2 - Zig when you zag
CRAYON - Crayon
DCEPC705 - Weird Points
DCEPC206 - Its a Murder!
KOPC12G - K12-Bored of Suffixes and Prefixes
TRIPINV - Mega Inversions
C. Subsequences
D. Ball
J. The Kamphaeng Phet's Chedis
E. Garlands
E. Inversions After Shuffle
D. Cairo Market
E. Goodbye Souvenir
ADACABAA - Ada and Species
A. Thor
F - Fundraising
Sqrt Decomposition
UVA - 12003 - Array Transformer SOLUTION
UVA - 11990 Dynamic Inversion SOLUTION
GIVEAWAY
C. Till I Collapse
D. Destiny
E. Holes
E. XOR and Favorite Number
D. Powerful array SOLUTION
DQUERY
Segment Tree
Treap (Cartesian tree)
ADAAPHID
ADACROP
E. Radio stations
COUNT1IT
IITWPC4D
ALLIN1
D. Dog Show
D. Yet Another Array Queries Problem SOLUTION
MEANARR
TWIST
KOILINE
PRESTIGE
Sqrt Tree
Product on the segment by modulo
Editorial: 1 2 3
Deleting from a data structure in O(T(n)logn)
A. Connect and Disconnect
E. Addition on Segments
F. Extending Set of Points SOLUTION
Sparse Table
Note: Sparse Table is a data structure, that allows answering range queries. It can answer most range queries in O(logn) , but its true power is answering range minimum queries (or equivalent range maximum queries). For those queries it can compute the answer in O(1) time.
The only drawback of this data structure is, that it can only be used on immutable arrays. This means, that the array cannot be changed between two queries. If any element in the array changes, the complete data structure has to be recomputed.
Rsources:
Tanvir's Blog
E-maxx
GeeksForGeeks
HackerEarth
Tushar Roy Video
Topcoder
Codechef
adilet.org_blog_sparse-table
Implementation: according to (This ) problem
Chinese Remainder Theorem
Resources:
Chinese Remainder Theorem
Chinese Remainder Theorem ( E-Maxx)
GeeksForGeeks
forthright48 - Coprime Moduli part1
forthnight48- Non Coprime Moduli part 2
Codeforces article
Problems:
Chinese Remainder Theorem (non-relatively prime moduli)
Cheese and Random Toppings SOLUTION
1319 - Monkey Tradition SOLUTION
Number of Sequences
B. Remainders Game
Arkanoid (ark)
E. Billiard
Number of single cycle components in an undirected graph (CF-977E)
E. Cyclic Components
resource
হিন্টঃ প্রতিটি কম্পোনেন্ট এ চেক করবো তাদের প্রত্যেকটি নোডের ডিগ্রি দুই কিনা, যদি দুই হয় তাইলে সেটা একটা সিঙ্গেল সাইকেল কম্পোনেন্ট।
E-maxx training part - 03
Modular Multiplicative Inverse
UVa 11904 - One Unit Machine SOLUTION
Longest Increasing Subsequence Arrays SOLUTION
C. Beautiful Numbers
F. The Sum of the k-th Powers
A. Festival Organization
D. Nephren Runs a Cinema
Chinese Remainder Theorem
Number of Sequences
E. Billiard
Factorial modulo p in O(plogn)
Another Factorial Problem SOLUTION
FACTMODP - Factorial Modulo Prime
CF blog lik
geeksforgeeks
Discrete Root
F. Lunar New Year and a Recursive Sequence SOLUTION
Solving the DLP: Baby Step/Giant Step Algorithm
Discrete Logarithm
MOD - Power Modulo Inverted SOLUTION
GreyCode
Code
89. Gray Code ( leetCode)
Gray Code (Codechef)
249. Matrix (CF)
Submask Enumeration
E. Nuclear Fusion SOLUTION
E. Sandy and Nuts
1439 - Exclusive Access 2
11825 - Hackers' Crackdown
Arbitrary-Precision Arithmetic
10183 - How Many Fibs? SOLUTION
10106 - Product SOLUTION
787 - Maximum Sub-sequence Product SOLUTION
MUL - Fast Multiplication
GCD2 - GCD2
10083 - Division
495 - Fibonacci Freeze
10925 - Krakovia
10814 - Simplifying Fractions
623 - 500!
Project Euler #20: Factorial digit sum
12924 - Immortal Rabbits
IWGBS - 0110SS
D. Notepad
Fast Fourier transform
Bangla blog
Operations on polynomials and series
FACT0 - Integer Factorization (15 digits)
FACT0 - Integer Factorization (15 digits)
টপিকঃ প্রাইম ফ্যাক্টর
হিন্টঃ সিভ দিয়ে করলে টাইম লিমিট, নরমালি করতে হবে। প্রথমে x = ২ দিয়ে যতবার যায় ভাগ তারপর ৩ দিয়ে , এরপর ৫ দিয়ে...
যখন x*x >N হয়ে যাবে তখন লুপটা ব্রেক হবে।
এরপর শেষে সংখ্যাটি ১ এর চেয়ে বড় থাকলে ওইটা একটা প্রাইম নাম্বার হবে, আর প্রতিবার ভাগ করার সময় একটা কাউন্ট রাখবো যেইটা দ্বারা বুঝবো ওইটা ওই প্রাইম ডিভিজর এর কাউন্ট।😀
কোডঃ
E-maxx training part - 02
Primality tests
Integer factorization
FACT0 - Integer Factorization (15 digits) Solution
FACT1 - Integer Factorization (20 digits)
FACT2 - Integer Factorization (29 digits)
GCPC 15 - Divisions
Euler's totient function
ETF - Euler Totient Function SOLUTION
UVA #10179 "Irreducible Basic Fractions
UVA #10299 "Relatives"
UVA #11327 "Enumerating Rational Numbers"
1673. Admission to Exam
UVA 10990 - Another New Function
Golu and Sweetness
LCMSUM - LCM Sum
GYM - Simple Calculations (F)
UVA 13132 - Laser Mirrors
GCDEX - GCD Extreme
UVA 12995 - Farey Sequence
TIP1 - Totient in permutation (easy)
1007 - Mathematically Hard
DCEPCA03 - Totient Extreme
NAJPWG - Playing with GCD
DCEPC12G - G Force
INVPHI - Smallest Inverse Euler Totient Function
D. Power Tower
Number of divisors / sum of divisors
COMDIV - Number of common divisors SOLUTION
DIVSUM - Divisor Summation SOLUTION
DIVSUM2 - Divisor Summation (Hard)
E-maxx training part - 01
Binary Exponentiation
1230 - MODEX Solution
11029 - Leading and Trailing Solution
I. Parking Lot
LASTDIG - The last digit
LOCKER - Magic of the locker
LA - 3722 Jewel-eating Monsters
ZSUM - Just Add It
Euclidean algorithm for computing the greatest common divisor
Extended Euclidean Algorithm
Linear Diophantine Equation
CEQU - Crucial Equation Solution
106. The equation
A. Ebony and Ivory
Get AC in one go
1306 - Solutions to an Equation
Fibonacci Numbers
MAIN74 - Euclids algorithm revisited Solution
FIBOSUM - Fibonacci Sum
Is Fibo Solution
Project Euler #2: Even Fibonacci numbers
Sieve of Eratosthenes
TDPRIMES - Printing some primes --> Solution
HS08PAUL - A conjecture of Paul Erdős
VECTAR8 - Primal Fear
PTRI - primes triangle (I)
A. Almost Prime
B. Sherlock and his girlfriend
NGIRL - Namit In Trouble
DCEPC505 - Bazinga!
Project Euler #134: Prime pair connection
NFACTOR - N-Factorful
BSPRIME - Binary Sequence of Prime Number
UVA 11353 - A Different Kind of Sorting
PRIMES2 - Printing some primes (Hard)
A. Noldbach problem
B. Colliders