├── README.md └── Road Map ├── Level 0.md ├── Level 1.md ├── Level 2.md ├── Level 3.md └── README.md /README.md: -------------------------------------------------------------------------------- 1 | # Competitive Programming Library 2 | Some materials for competitve programming 3 | 4 | ### Content 5 | * [Road map](https://github.com/hazemadelkhalel/Competitive-Programming-Library/blob/main/Road%20Map/README.md): Practice plans for different levels. 6 | * To be continue 7 | 8 | ### Contributing 9 | The ongoing development of this project aims to offer a comprehensive guide for competitive programmers, ranging from beginners to the highest achievable level. The objective is to include additional code snippets for various algorithms. You have the opportunity to contribute to the project by: 10 | * My templates for different algorithms will be added. You can contribute to codes by: 11 | - Rectifying bugs and typos in comments, adding or improving comments, enhancing naming conventions, or refining the code structure to make it more concise, readable, and efficient. This can be done by raising issues or submitting pull requests directly. 12 | - Proposing additional data structures or algorithms to be incorporated into the project. You can suggest these through issues. 13 | 14 | * Regarding road map, I am constructing based on my coaching experience at my university and my personal practice. Your contributions to this branch are highly valued due to the following considerations: 15 | - From my perspective, the lower difficulty levels tend to overlap. Hence, assigning a difficulty level to a problem requires the expertise of an experienced coach or feedback from participants with the desired competitive programming experience. 16 | - Problem selection (especially topic-specific problems) should aim to cover a wide range of experience points, encompassing various techniques, tricks, implementation details, and so on. This approach may result in excluding easier problems that are not suitable for initial stages, but that is acceptable. 17 | - Editing plan description, style, content, topic resources, problems or any other thing related. 18 | 19 | * You can contribute to this in any way you want (issues, pull requests or [contact me](https://codeforces.com/profile/Rokba) to discuss it. 20 | 21 | -------------------------------------------------------------------------------- /Road Map/Level 0.md: -------------------------------------------------------------------------------- 1 | # Level 0 2 | Duration: 20 rokba days. 3 | 4 | Target: be able to solve CF-div2 A(B) 5 | 6 | ### Content 7 | * Introduction to Programming 8 | * Data types and arithmetic & bitwise operations 9 | * Conditions and logical operations 10 | * Loops 11 | * Arrays and Strings 12 | * Function - Built-In Functions 13 | * Recursion 14 | * Complexity Analysis 15 | * Constructive Algorithms + Greedy 16 | * STLs I (Vector, Pairs, Deque, Queue, Stack) 17 | * STLs II (Set, Map, Priority queue) 18 | 19 | ## Timeline 20 | To use this plan: 21 | - For coaches: each point of the content takes a week (1 session for teaching + 1 session for upsolving the sheat) 22 | - For trainees: try to master each point in at most (3-5) days (learning + finishing the sheet) 23 | 24 | ## Sheets 25 | 26 | * Rokba's Park [Vjudge Sheets](https://vjudge.net/group/rokba) 27 | * For extra problems check this [Problems Sheet](https://docs.google.com/spreadsheets/d/1blSbPr1pAFZSzlAi2IVdTeytz2yO7Ejx9SeQWOSxY0w/edit#gid=1542041463) 28 | 29 | ## Materials 30 | Topic | Videos | Blogs | Templates 31 | --- | --- | --- | --- 32 | Introduction to Programming | [Errichto](https://www.youtube.com/watch?v=xAeiXy8-9Y8&t=4s) | [Intro to Competitive Programming](https://usaco.guide/general/intro-cp?lang=cpp) | 33 | Data types | [Data Types](https://www.youtube.com/watch?v=k2vrTIAIhRo&t=488s) | [Data Types](https://usaco.guide/general/data-types?lang=cpp) | 34 | Conditions | [Conditions](https://www.youtube.com/watch?v=Zfm-138maOE) | [If Condition](https://www.w3schools.com/cpp/cpp_conditions.asp) 35 | Arrays | [Working With Arrays](https://www.youtube.com/watch?v=HpBel7_2k0k) | [Arrays](https://www.w3schools.com/cpp/cpp_arrays.asp) 36 | Strings | [Strings](https://www.youtube.com/watch?v=-t07hCkdHjI) | [W3School Strings](https://www.w3schools.com/cpp/cpp_strings.asp) 37 | Functions| [Intro to Functions](https://www.youtube.com/watch?v=VZYMp7SY0W4) | [W3School Functions](https://www.w3schools.com/cpp/cpp_functions.asp) 38 | Recursion | [Buckys Recursion](https://www.youtube.com/watch?v=4agL-MQq05E) | [W3School Recursion](https://www.w3schools.com/cpp/cpp_functions_recursion.asp) 39 | Complexity Analysis | [Time Complexity and Big O Notation](https://www.youtube.com/watch?v=QnRx6V8YQy0) | [Usaco Time Complexity](https://usaco.guide/bronze/time-comp?lang=cpp) 40 | STLs | [Adel Nesem in Arabic](https://www.youtube.com/watch?v=4hhz69S15wU&list=PLCInYL3l2AainAE4Xq2kdNGDfG0bys2xp) , [In English](https://www.youtube.com/watch?v=LyGlTmaWEPs&list=PLk6CEY9XxSIA-xo3HRYC3M0Aitzdut7AA) | [Intro to Data Structures](https://usaco.guide/bronze/intro-ds?lang=cpp) , [Sets and Maps](https://usaco.guide/bronze/intro-sets?lang=cpp) 41 | 42 | ## Notes 43 | * Resources: 44 | 45 | - [Competitive Programming 3](https://drive.google.com/file/d/145iYn20prtNwKYLbN6GpGNlzAtCQuSG_/view?usp=sharing) 46 | - [Usaco Guide](https://usaco.guide/) 47 | - [CP Algorithms](https://cp-algorithms.com/) 48 | - [Kactl Templates](https://github.com/kth-competitive-programming/kactl) 49 | - Soon I will upload some playlists for each point 50 | 51 | * Solutions & Tutorials: 52 | - For atcoder and CF problems. Authors offer a tutorial for each problem also you can see others accepted submissions. 53 | - For UVA problems, you can google it 54 | -------------------------------------------------------------------------------- /Road Map/Level 1.md: -------------------------------------------------------------------------------- 1 | # Level 1 2 | Duration: 25 rokba days. 3 | 4 | Target: be able to solve CF-div2 AB(C) 5 | 6 | ### Content 7 | * STLs I (Vector, Pairs, Deque, Queue, Stack) 8 | * STLs II (Set, Map, Priority queue) 9 | * Brute Force + Constructive algorithms + Greedy 10 | * Prefix-Suffix + Sliding Window 11 | * Two Pointers + Binary Search 12 | * Basics Bitmasks and complete search 13 | * Number Theory 14 | - Check Prime 15 | - Sieve Algorithm 16 | - Get Divisors 17 | - Fast Power 18 | - Modular Arithmetic 19 | - GCD & LCM 20 | * Basic counting 21 | - nCr & nPr 22 | - Product & Sum Rule 23 | * Basic Geometry 24 | * Basic Probability 25 | 26 | ## Timeline 27 | To use this plan: 28 | - For coaches: each point of the content takes a week (1 session for teaching + 1 session for upsolving the sheat) 29 | - For trainees: try to master each point in at most (3-5) days (learning + finishing the sheet) 30 | 31 | ## Sheets 32 | 33 | * Rokba's Park [Vjudge Sheets](https://vjudge.net/group/rokba) 34 | * For extra problems check this [Problems Sheet](https://docs.google.com/spreadsheets/d/1blSbPr1pAFZSzlAi2IVdTeytz2yO7Ejx9SeQWOSxY0w/edit#gid=1542041463) 35 | 36 | ## Materials 37 | Topic | Videos | Blogs | Templates 38 | --- | --- | --- | --- 39 | Brute Force | --- | --- | 40 | Greedy | [Abdul Bary](https://www.youtube.com/watch?v=ARvQcqJ_-NY&t=1s) | [Greedy](https://www.programiz.com/dsa/greedy-algorithm) | 41 | Prefix-Suffix | [Mike](https://www.youtube.com/watch?v=7pJo_rM0z_s) | [Prefix Sum](https://usaco.guide/silver/prefix-sums?lang=cpp) | 42 | Sliding Window | --- | [Sliding Window](https://usaco.guide/gold/sliding-window?lang=cpp) | 43 | Sorting | [Playlist](https://www.youtube.com/watch?v=p__ETf2CKY4&list=PLjuNEWpkTZauDAstircLx0B-tsERPsjtT) | [Sorting](https://usaco.guide/bronze/intro-sorting?lang=cpp) | 44 | Two Pointers | [Two Pointers](https://www.youtube.com/watch?v=BCLfxQja9dI&t=267s) | [Two Pointers Usaco](https://usaco.guide/silver/two-pointers) , [ITMO](https://codeforces.com/edu/course/2/lesson/9) | 45 | Binary Search | [Errichto](https://www.youtube.com/watch?v=GU7DpgHINWQ&t=40s) | [ITMO](https://codeforces.com/edu/course/2/lesson/6) , [Usaco](https://usaco.guide/silver/binary-search?lang=cpp) | 46 | Number Theory | [Dardy's Session](https://www.youtube.com/watch?v=-3kk-Q2HJeU) | [Divisibility](https://usaco.guide/gold/divisibility?lang=cpp) | 47 | Bitmasks | --- | [BITMASKS FOR BEGINNERS](https://codeforces.com/blog/entry/18169) , [Bitmasking](https://codeforces.com/blog/entry/17973) , [CP Algorithm](https://cp-algorithms.com/algebra/all-submasks.html) | 48 | Basic counting | --- | [Combinatorics](https://usaco.guide/gold/combo?lang=cpp)| 49 | 50 | ## Notes 51 | * Resources: 52 | 53 | - [Competitive Programming 3](https://drive.google.com/file/d/145iYn20prtNwKYLbN6GpGNlzAtCQuSG_/view?usp=sharing) 54 | - [Usaco Guide](https://usaco.guide/) 55 | - [CP Algorithms](https://cp-algorithms.com/) 56 | - [Kactl Templates](https://github.com/kth-competitive-programming/kactl) 57 | - Soon I will upload some playlists for each point 58 | 59 | * Solutions & Tutorials: 60 | - For atcoder and CF problems. Authors offer a tutorial for each problem also you can see others accepted submissions. 61 | - For UVA problems, you can google it 62 | -------------------------------------------------------------------------------- /Road Map/Level 2.md: -------------------------------------------------------------------------------- 1 | # Level 2 2 | Duration: 28 rokba days. 3 | 4 | Target: be able to solve CF-div2 ABC(D) 5 | 6 | ### Content 7 | * Graph representation - DFS 8 | * Shortest Path (0-1 BFS, Dijkstra) 9 | * Number Theory (Factorization) 10 | * Combinatorics 11 | * Backtracking 12 | * Introduction to Dynamic Programming (Recursive) 13 | * Introduction to Dynamic Programming (Iterative) 14 | * DSU - MST (Kruskal) 15 | * Binary Indexed Tree (BIT) + Sparse Table 16 | * Geometry 17 | * Probability 18 | * Floyd-Warshall (All-pairs shortest paths) - Bellman 19 | * Divide and Conquer 20 | 21 | ## Timeline 22 | To use this plan: 23 | - For coaches: each point of the content takes a week (1 session for teaching + 1 session for upsolving the sheat) 24 | - For trainees: try to master each point in at most (3-5) days (learning + finishing the sheet) 25 | 26 | ## Sheets 27 | 28 | * Rokba's Park [Vjudge Sheets](https://vjudge.net/group/rokba) 29 | * For extra problems check this [Problems Sheet](https://docs.google.com/spreadsheets/d/1blSbPr1pAFZSzlAi2IVdTeytz2yO7Ejx9SeQWOSxY0w/edit#gid=1542041463) 30 | 31 | ## Materials 32 | Topic | Videos | Blogs | Templates 33 | --- | --- | --- | --- 34 | Graph representation - DFS | [Abdul Bary](https://www.youtube.com/watch?v=pcKY4hjDrxk&t=968s) | [is-this-fft Blog](https://codeforces.com/blog/entry/68138) | 35 | BFS | [Abdul Bary](https://www.youtube.com/watch?v=pcKY4hjDrxk&t=968s) | [0-1 BFS](https://cp-algorithms.com/graph/01_bfs.html) , [CP algorithms](https://codeforces.com/blog/entry/22276) | 36 | Dijkstra | [Abdul Bary](https://www.youtube.com/watch?v=XB4MIexjvY0&t=740s) | [CP algorithm](https://cp-algorithms.com/graph/dijkstra.html) 37 | Floyd-Warshall | [Abdul Bary](https://www.youtube.com/watch?v=oNI0rf2P9gE) | [Floyed](https://cp-algorithms.com/graph/all-pair-shortest-path-floyd-warshall.html) 38 | DSU | [ITMO](https://codeforces.com/edu/course/2/lesson/7) | [Codforces Blog](https://codeforces.com/blog/entry/57338), [CP algorithm](https://cp-algorithms.com/data_structures/disjoint_set_union.html) 39 | MST | [Abdul Bary](https://www.youtube.com/watch?v=4ZlRH0eK-qQ) | [Kruskal](https://cp-algorithms.com/graph/mst_kruskal.html) 40 | Number Theory | [Dardy's Session](https://www.youtube.com/watch?v=-3kk-Q2HJeU) | [Factorization in Log(N)](https://codeforces.com/blog/entry/7262) 41 | Combinatorics | --- | [Combinatorics](https://usaco.guide/gold/combo?lang=cpp)| 42 | Binary Indexed Tree | --- | [Codforces Blog](https://codeforces.com/blog/entry/57292) , [CP algorithmms](https://cp-algorithms.com/data_structures/fenwick.html) 43 | Intro DP | [Errichto](https://www.youtube.com/watch?v=YBSt1jYwVfU&t=4s) | [Everything on DP](https://codeforces.com/blog/entry/67679) , [Usaco](https://usaco.guide/gold/intro-dp?lang=cpp) 44 | 45 | 46 | ## Notes 47 | * Resources: 48 | 49 | - [Competitive Programming 3](https://drive.google.com/file/d/145iYn20prtNwKYLbN6GpGNlzAtCQuSG_/view?usp=sharing) 50 | - [Usaco Guide](https://usaco.guide/) 51 | - [CP Algorithms](https://cp-algorithms.com/) 52 | - [Kactl Templates](https://github.com/kth-competitive-programming/kactl) 53 | - Soon I will upload some playlists for each point 54 | 55 | * Solutions & Tutorials: 56 | - For atcoder and CF problems. Authors offer a tutorial for each problem also you can see others accepted submissions. 57 | - For UVA problems, you can google it 58 | -------------------------------------------------------------------------------- /Road Map/Level 3.md: -------------------------------------------------------------------------------- 1 | # Level 3 2 | Duration: 30 rokba days or more. 3 | 4 | Target: be able to solve CF-div2 ABCD(E) 5 | 6 | ### Content 7 | * SCC + Tarjan 8 | * LCA 9 | * Euler's Graph 10 | * Mobius + Linear Diophantine Equations 11 | * DP (optimizations - ranges - bitmask - digits ... etc.) 12 | * Segment tree 13 | * Segment tree with lazy propagation 14 | * Matrix Exponentiation 15 | * Trie 16 | * KMP algorithm - Z algorithm 17 | * Hashing Rabin-Karp algorithm 18 | * Suffix Array 19 | * Game Theory 20 | * Small to Large Trick 21 | * Mo Algorithm 22 | * Convex Hull Trick 23 | * Matching Kuhn + Hopcroft 24 | * Xor Basis 25 | 26 | ## Timeline 27 | To use this plan: 28 | - For coaches: each point of the content takes a week (1 session for teaching + 1 session for upsolving the sheat) 29 | - For trainees: try to master each point in at most (3-5) days (learning + finishing the sheet) 30 | 31 | ## Sheets 32 | 33 | * Rokba's Park [Vjudge Sheets](https://vjudge.net/group/rokba) 34 | * For extra problems check this [Problems Sheet](https://docs.google.com/spreadsheets/d/1blSbPr1pAFZSzlAi2IVdTeytz2yO7Ejx9SeQWOSxY0w/edit#gid=1542041463) 35 | 36 | ## Materials 37 | Topic | Videos | Blogs | Templates 38 | --- | --- | --- | --- 39 | Sparse Table | [Errichto](https://www.youtube.com/watch?v=0jWeUdxrGm4&t=3s) | [Sparse Table](https://cp-algorithms.com/data_structures/sparse-table.html) | 40 | LCA | [Errichto](https://www.youtube.com/watch?v=dOAxrhAUIhA&t=758s) | [LCA with Binray Lifting](https://cp-algorithms.com/graph/lca_binary_lifting.html) | 41 | Euler's Graph | [WilliamFiset](https://www.youtube.com/watch?v=8MpoO2zA2l4) | [Euler Path](https://cp-algorithms.com/graph/euler_path.html) 42 | DP | --- | [Digit DP](https://codeforces.com/blog/entry/53960) , [Tricks](https://codeforces.com/blog/entry/47764) , [Matrix Power](https://codeforces.com/blog/entry/67776), [SOS DP](https://codeforces.com/blog/entry/45223) , [Some Techniques](https://codeforces.com/blog/entry/43256) , [Usaco](https://usaco.guide/gold/intro-dp?lang=cpp) 43 | Segment tree | [EDU ITMO codeforces](https://codeforces.com/edu/course/2/lesson/4) | [Segment Tree](https://cp-algorithms.com/data_structures/segment_tree.html) 44 | Segment tree with lazy propagation| [EDU ITMO 2 Codeforces](https://codeforces.com/edu/course/2/lesson/5) | [Codeforces's Blog](https://codeforces.com/blog/entry/18051) 45 | KMP algorithm | [Abdul Bary](https://www.youtube.com/watch?v=V5-7GzOfADQ) | [KMP](https://cp-algorithms.com/string/prefix-function.html) 46 | Z algorithm | --- | [Z function](https://cp-algorithms.com/string/z-function.html) 47 | Rabin-Karp | [Abdul Bary](https://www.youtube.com/watch?v=qQ8vS2btsxI&t=4s) | [Rabin Karb](https://cp-algorithms.com/string/rabin-karp.html) 48 | 49 | ## Notes 50 | * Resources: 51 | 52 | - [Competitive Programming 3](https://drive.google.com/file/d/145iYn20prtNwKYLbN6GpGNlzAtCQuSG_/view?usp=sharing) 53 | - [Usaco Guide](https://usaco.guide/) 54 | - [CP Algorithms](https://cp-algorithms.com/) 55 | - [Kactl Templates](https://github.com/kth-competitive-programming/kactl) 56 | - Soon I will upload some playlists for each point 57 | 58 | * Solutions & Tutorials: 59 | - For atcoder and CF problems. Authors offer a tutorial for each problem also you can see others accepted submissions. 60 | - For UVA problems, you can google it 61 | -------------------------------------------------------------------------------- /Road Map/README.md: -------------------------------------------------------------------------------- 1 | # Levels Description 2 | These levels will help you improve in competitive programming, and they do not require you to have prior knowledge or experience in problem solving. The plan is currently under development and being tested by the FCAI ACM community. 3 | 4 | There are 4 different levels and the requirements for them: 5 | * [Level 0](https://github.com/hazemadelkhalel/Competitive-Programming-Library/blob/main/Road%20Map/Level%200.md): beginner with no prior knowledge or experience in competitive programming. The target of this plan is to be able to solve CF-div2 A(B) expected to be close to the pupil and can reach it. 6 | 7 | * [Level 1](https://github.com/hazemadelkhalel/Competitive-Programming-Library/blob/main/Road%20Map/Level%201.md): has basic knowledge of most of the topics and good implementation skills. The target of this plan is to be able to solve CF-div2 AB(C) expected to be a stable pupil and can be a specialist. 8 | 9 | * [Level 2](https://github.com/hazemadelkhalel/Competitive-Programming-Library/blob/main/Road%20Map/Level%202.md): know basic data structures such as STLs and good in some other techniques (Binary search, Static range queries, and sorting algorithms) also has good basic number theory and combinatorics. The target of this plan is to be able to solve CF-div2 ABC(D) expected stable specialist and can be an expert. 10 | 11 | * [Level 3](https://github.com/hazemadelkhalel/Competitive-Programming-Library/blob/main/Road%20Map/Level%203.md): good in graphs and know most of graph traversal algorithms and learn some techniques such as basic dynamic programming (Knapsack - LCS - Coin change - LIS). The target of this plan is to be able to solve CF-div2 ABCD(E) expected stable expert. 12 | 13 | Let's define something to measure how much time we trained and benefited. Rokba's day is a day at which you spending 14 hours in training and sleeping/eating/wasting time in 10 hours :). While this may not be practical for our everyday lives, it is important to establish a specific type of day that fosters a sense of progress. This definition of a day will be utilized in the plan. 14 | 15 | Let's make an equation 16 | Rokba's Day = (1-3) of normal days. 17 | 18 | --------------------------------------------------------------------------------