Striver's CP List (Solely For Preparing For Coding Rounds of Top Prod Based Companies)
Striver's CP List (Solely For Preparing For Coding Rounds of Top Prod Based Companies)
Striver's CP List (Solely For Preparing For Coding Rounds of Top Prod Based Companies)
All the following questions have been answered in this video ->
https://youtu.be/QtTPohzfxA8
1. Before starting off CP, make sure you know one language, which means you how to
take an input, print something, run for loops, snd STL/Collection for the language you
are using, these things are more than enough to start, just don’t think you need
everything in place to start, so just start.
2. At first make sure your constructive algorithms are good, which means you can solve
simple story line problems. For that my suggestion will be to do A2OJ
ladder(alternative: https://a2oj.herokuapp.com/), 50 A problems and 50 B level
problems to start off with.
3. Next I will be giving you the algorithms name you need to know and 5-10 problems
on each of them. These problems will help you to understand the concept of the
algorithm, and will help you to understand how we can tweak the algorithms to solve
given problems. Even after this you don’t feel comfortable with the Algorithm, my
suggestion will be to google some more problems and solve. To reach an expert level
at Codeforces, you just need to solve A, B and C problems at quick succession and
on a constant basis. There are very few chances that you will be encountering an
algorithmic problem on Codeforces unless and until its the D level problem or
beyond. So you need to do as many algorithmic problems as you can, which will help
you during your coding rounds.
Disclaimer: If you feel it's getting tough, I will suggest to do SDE sheet as well as
you can, and take the concepts as properly as you can!!
Linear Search:
1. https://www.hackerearth.com/practice/algorithms/searching/linear-search/prac
tice-problems/algorithm/simple-search-4/
2. https://www.hackerearth.com/practice/algorithms/searching/linear-search/prac
tice-problems/algorithm/maximum-sum-4-f8d12458/
3. https://www.hackerearth.com/practice/algorithms/searching/linear-search/prac
tice-problems/algorithm/mannas-first-name-4/
4. https://www.codechef.com/problems/SEGM01
5. https://www.hackerearth.com/practice/algorithms/searching/linear-search/prac
tice-problems/algorithm/rest-in-peace-21-1/
PrefixSum:
1. https://www.spoj.com/problems/CSUMQ/
2. https://www.codecProblem CSUMQhef.com/problems/BLONDIE
3. https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&categor
y=24&page=show_problem&problem=1474
4. https://www.hackerrank.com/contests/ab-yeh-kar-ke-dikhao/challenges/kj-and
-street-lights/leaderboard (learn the scanline algo trick, probably from here
https://www.youtube.com/watch?v=TSUvGqRFlug (timeStamp: 2:00)
5. https://www.codechef.com/COW42020/problems/COW3E/ (2d prefix sum)
6. https://www.codechef.com/problems/COWA19B
7. https://www.codechef.com/problems/MXPOWER
Sliding Window:
1. https://www.hackerrank.com/challenges/min-max-riddle/problem (uses nge,
read in stacks)
2. https://codeforces.com/problemset/problem/363/B
3. https://www.codechef.com/problems/SHIVIGOD (try to do using sliding
window)
4. https://www.codechef.com/problems/BDGFT
5. https://www.codechef.com/problems/ECAPR206
6. https://codeforces.com/problemset/problem/1341/B
7. https://www.codechef.com/problems/SUMPOWER (Can be solved using
prefix sum, but try to do without that by using O(1) space)
Binary Search:
(make sure you watch STL of BS ->
https://www.youtube.com/watch?v=edJ19qIL8WQ)
1. https://www.hackerearth.com/practice/algorithms/searching/binary-search/pra
ctice-problems/algorithm/bishu-and-soldiers/
2. https://www.spoj.com/problems/AGGRCOW/
3. https://www.interviewbit.com/problems/painters-partition-problem/
4. https://codeforces.com/problemset/problem/975/C
5. https://www.codechef.com/problems/DSTROY
6. https://codeforces.com/problemset/problem/812/C
7. https://codeforces.com/problemset/problem/363/D
8. https://www.codechef.com/problems/FAKEBS
Stack/Queues/PriorityQueues:
1. https://www.hackerrank.com/challenges/balanced-brackets/problem
2. https://www.codechef.com/status/THESA
3. https://www.spoj.com/problems/ANARC09A/
4. https://www.hackerearth.com/practice/data-structures/queues/basics-of-queu
es/practice-problems/algorithm/monk-and-power-of-time-3a648bf0/
5. https://www.hackerearth.com/challenges/competitive/code-monk-heaps-and-p
riority-queues-1/algorithm/little-monk-and-williamson/
6. https://codeforces.com/contest/5/problem/C
7. https://www.hackerearth.com/practice/data-structures/stacks/basics-of-stacks/
practice-problems/algorithm/little-shino-and-pairs/
8. https://www.hackerearth.com/practice/data-structures/trees/heapspriority-que
ues/practice-problems/algorithm/seating-arrangement-6b8562ad/
1. https://cses.fi/problemset/task/1674
2. https://cses.fi/problemset/task/1130
3. https://www.spoj.com/problems/ABCPATH/
4. https://cses.fi/problemset/task/1131
5. https://codeforces.com/problemset/problem/1336/A
6. https://codeforces.com/contest/734/problem/E (Bit tougher DFS)
7. https://cses.fi/problemset/task/1688 (LCA)
8. https://www.spoj.com/problems/DISQUERY/
9. https://cses.fi/problemset/task/1131 (LCA)
10. https://cses.fi/problemset/task/1135 (LCA)
11. https://codeforces.com/contest/208/problem/E
12. https://codeforces.com/contest/1328/problem/E
13. https://codeforces.com/contest/519/problem/E
14. Still want more for LCA, find here -> https://codeforces.com/blog/entry/43917
Graph Algorithms (DFS, BFS, Dijsktra, Floyd Washall, Bellman Ford, Bridges,
0-1 BFS, Bipartite, Topo-sort ...) :
1. https://cses.fi/problemset/task/1192 (bfs)
2. https://cses.fi/problemset/task/1193
3. https://codeforces.com/problemset/problem/242/C
4. https://cses.fi/problemset/task/1193 (Connected Components)
5. https://cses.fi/problemset/task/1667
6. https://cses.fi/problemset/task/1669
7. https://cses.fi/problemset/task/1671 (Dijsktra)
8. https://codeforces.com/problemset/problem/20/C
9. https://cses.fi/problemset/task/1672 (Floyd Warshall)
10. https://cses.fi/problemset/task/1673
11. https://cses.fi/problemset/task/1197 (Bellman Ford)
12. https://cses.fi/problemset/task/1679 (topo sort)
13. https://codeforces.com/problemset/problem/510/C
14. https://codeforces.com/problemset/problem/59/E (tough Dijsktra)
15. https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=s
how_problem&problem=737
16. https://www.spoj.com/problems/SUBMERGE/
17. https://www.codechef.com/problems/REVERSE (0-1 BFS)
18. https://codeforces.com/contest/1296/problem/E1 (Bipartite)
Once you have done this, if you feel like doing more, search and do as much
as you can on the algo names above..
Dynamic Programming:
1. https://atcoder.jp/contests/dp/tasks/dp_a
2. https://atcoder.jp/contests/dp/tasks/dp_b
3. https://atcoder.jp/contests/dp/tasks/dp_c
4. https://atcoder.jp/contests/dp/tasks/dp_d
5. https://atcoder.jp/contests/dp/tasks/dp_e
6. https://atcoder.jp/contests/dp/tasks/dp_f
7. https://atcoder.jp/contests/dp/tasks/dp_h
8. https://atcoder.jp/contests/dp/tasks/dp_i
9. https://cses.fi/problemset/task/1635
10. https://cses.fi/problemset/task/1636
11. https://codeforces.com/problemset/problem/1015/E1
12. https://codeforces.com/problemset/problem/977/F
13. https://codeforces.com/problemset/problem/1155/D
14. https://codeforces.com/problemset/problem/1341/D (I also have a video on
this, do check out)
15. https://vjudge.net/problem/LightOJ-1068
16. https://vjudge.net/problem/LightOJ-1205
17. https://www.codechef.com/problems/DGTCNT
18. https://www.spoj.com/problems/CPCRC1C/
19. https://www.spoj.com/problems/PR003004/
20. https://codeforces.com/contest/628/problem/D
Disjoint Set:
1. https://www.hackerearth.com/practice/data-structures/disjoint-data-strutures/b
asics-of-disjoint-data-structures/practice-problems/algorithm/owl-fight/
2. https://www.hackerearth.com/practice/data-structures/disjoint-data-strutures/b
asics-of-disjoint-data-structures/practice-problems/algorithm/still-maximum/
3. https://codeforces.com/contest/25/problem/D
4. https://www.spoj.com/problems/CLFLARR/ (offline)
5. https://codeforces.com/contest/151/problem/D
6. https://codeforces.com/problemset/problem/547/B
Sqrt Decomposition:
1. https://www.hackerearth.com/problem/algorithm/gcd-problem-1/
2. https://www.hackerearth.com/problem/algorithm/final-question/
3. https://codeforces.com/contest/220/problem/B
4. https://codeforces.com/contest/86/problem/D (Mo’s Algo)
5. https://codeforces.com/contest/242/problem/E
6.
Fenwick Tree:
1. https://www.spoj.com/problems/INVCNT/
2. https://codeforces.com/gym/100741/problem/A
3. https://www.spoj.com/problems/MATSUM/
4. https://codeforces.com/gym/100741/problem/A
5. https://www.spoj.com/problems/DQUERY/
6. https://codeforces.com/problemset/problem/61/E