- Chocolate Feast
- Balloons
- Aladdin and the Optimal Invitation [O(n) adhoc solution exists, also solvable in nlogn using binary search]
- Stacks of Flapjacks
- Pole Position
Backtracking
- Turn the Lights Off [Explanation]
- Another n-Queen Problem
- The Sultan's Successors [straightforward]
- Flip It! [stack / vector]
- Wedding of Sultan [stack] [Editorial]
- Fence Repair [priority queue in reverse order]
- A and B and Interesting Substrings [map, pair]
- Parentheses Balance [stack]
- Energetic Pandas [vector+lower bound, counting]
- Haircut
Binary Tree:
Bitmask DP:
Bellman Ford:
BFS:
- Number Transformation [i solved with dp]
- Chef and Digit Jumps [tricky bfs variant]
- Prime Path
- One Unit Machine [Mod Inverse]
Bridge:
Brute Force:
Combinatorics:
- Colorful Board
- A Careful Approach (next permutation + binary search)
Connected Component:
Counting:
- How Many Zeroes? [iterative and dp both solution exists]
- Not the best (2nd / kth)
- Almost Shortest Path (path track)
DFS:
DP:
- Maximum Square
- nth Permutation
- Jogging Trails [Warshall+bitmask, Chinese Postman Problem]
- Chest of Drawers [basic]
- Dividing up [iterative dp with a little trick]
- Breaking Strings [Knuth's optimization, similar to Cutting Sticks with higher n]
- Antimatter
- Candy [0/1 knapsack, tricky]
- Lighted Panels [bitmask]
- Heavy Cargo (similar: The Tourist Guide, modified warshall)
- Euclid's Game [ nim with a tricky observation]
Greedy:
Histogram:
Implementation:
Inclusion/Exclusion:
KMP:
- Period [failure function only]
LCS:
- Vacation [straightforward lcs]
- Answering Queries
- Points in Figures: Rectangles, Circles, and Triangles [basic, tricks, precision check]
- Feynman
- Coin Change (IV)
- 4 values whose sum is 0 (binary search / upper_bound, lower_bound)
- Square-Free Numbers (factor power)
- How Many Points? (gcd)
- Garden Game (bigmod, prime factor)
- Big Number (log10)
- Divisors (number of divisors)
- Prime Factors [straightforward]
- Game on Tree [+dfs]
Sieve:
- Help Hanzo [Segmented Sieve ]
- Printing some primes [bit seive]
- Basketball Game (queue)
- Billiard Balls
- Christmas Play [straightforward] [editorial]
- Broken Keyboard
- Sliding Window [classic, with explanation, beginner, deque]
Structure
- Wooden Sticks [STL pair]
Strongly Connected Component:
Trie
- XOR Sum ( cummulative XOR property: xor (L to R) = xor (1 to R) ^ xor (1 to L-1)
http://ideone.com/MaY68D...this my code for dish owner..i am getting wrong answer for this..plz help me...plz give some suggestions or hints or anything..plz
ReplyDelete