Skip to content

This repository is collection of lot of problems tag wise and their solution coded to help other users, also this contains lot of ready made modules for cp

Notifications You must be signed in to change notification settings

om-ashish-soni/Competitive-Programming

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

53 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Competitive Programming by om-ashish-soni

Hello everyone, I am Om Ashish Soni, Software Engineer at Mastercard, Top Competitive Coder from India, 3x Gold Medalist, 2x Published AI researcher, Gate Topper & Computer Engineer.

captionless image

We will go step by step journey for competitive programming and Data Structures and Algorithms

Phase 0 : Why Competitive Coding & DSA

  • MNCs and Medium size companies takes coding round & technical rounds in interview there they ask for data structures and algorithms problems.
  • Lot of real world problems can be solved very easily by using dsa.
  • This boosts your critical thinking, cognitive thinking, debugging and implementation skills, which helps infinitely as a future Software Engineer.

CP vs DSA :

  • DSA is helpful for placement, Competitive Coding is super set of DSA.
  • Competitive Coding is more like a game, brain sport, where people compete using human brain to solve any problem. DSA is more or less structured way of preparing for tech interviews.
  • Competitive Coding changes the fundamental way of thinking and tackling real world problems of life.

Personal Opinion :

  • If I was in my 1st / 2nd / 3rd year of college, I would start CP & DSA from today itself.
  • It’s never late to start.

Phase 1 : Pick one programming language

  • C++ , Java, Python ( pypy3 )
  • Learn the basics of language from youtube, geeksforgeeks, w3schools Learn about data types, operators, function, syntax, etc.

Phase 2 : Start Basic Problem Solving on Hackerrank :

Start solving picked language problems on hackerrank ( Any 1 language ):

  1. Solve C Hackerrank

  2. Solve C++ Hackerrank

  3. Solve Java Hackerrank

  4. Solve Python Hackerrank

  • Once you do any one of the above, you will have some grip on problem solving and language specific.
  • If you are not able to solve any problem, don’t giveup try the compile time and run time errors solution looking on google, stack overflow, geeks for geeks etc.
  • Atleast try for 10–20 times before looking at solution.

Start your problem solving with pattern printing problems

Practice :

Phase 3 : General Resources to learn any topic

Before we jump on learning various data structures and algorithms these are few general resources you may refer for any topic.

YouTube Resources :

Web Resources :

below is super helpful blog containing topic list

Phase 4 : Learning Array & String

  • Start learning array, string in your chosen language from youtube, geeksforgeeks, etc.
  • Practice them on Hackerrank.
  • If you feel comfortable then start solving array and string easy problems on leetcode.com / geeksforgeeks.org

Practice :

Phase 5 : Where and How to practice the problems

Before you do some more practice it is important to know what is best way and best practices to solve and practice problems.

Practice Platforms

How to practice on leetcode or any other platforms

  • Filter problems like below highlighted from easy to medium to hard,
  • Solve easy first gradually moving to medium, keep hard for some later time.

captionless image

  • Visit to leetcode.com, select a specific topic and start solving easy problems on it.
  • The more number of accepted solutions means the more easy problem is.

Topic-Wise Practice:

  • Focused practice on a specific topic ensures you master the underlying concepts and techniques.
  • It helps build confidence and prepares you to handle problems of that particular type with ease.

Random Problem-Solving:

  • Solving random problems simulates real competition scenarios where you don’t know the topic beforehand.
  • It trains you to identify the relevant topic and approach for solving the problem.
  • This practice improves adaptability, problem-recognition skills, and overall versatility as a programmer.

Advice to solve problem effectively:

  1. Have pen and paper,

  2. Read problem twice

  3. Read constraints twice

  4. List all approaches you can think of

  5. Dry run all tests cases with your hand on paper

  6. Now whatever you did see how can you code for it

  7. Atleast try for 1–2 hours before giving up

  8. Still can’t get it, try to see the topics

  9. Still can’t get it, try to see hint 1,2,…

  10. Still can’t get it, try to read blogs of other people’s solution, read approach and code if needed

  11. Still can’t get it, then watch video

  12. After you solve with editorials then observe what you missed

Phase 6 : Learning Math, Number Theory , Bit Manipulations

  • Math, Number Theory are all school level topics, for example primality, factorization, odd β€” even number, GCD, LCM etc.
  • Bit manipulation may be something new, may need to learn. Each number in the machine will be represented at the end using 0s and 1s, these are the problems based on bits. Binary Operations like bitwise AND, OR, NOT, XOR etc.

Resources :

Practice Problems :

Phase 7 : Learn Time & Space Complexity

  • Time Complexity ( TC ) & Space Complexity ( SC ) are not the topics, but they are important in order to understand
  • Time complexity gives an idea of execution time independent of language.
  • Space complexity gives an idea of space used execution of program independent of language.
  • Learn master’s theorem to prove / find time complexity.
  • Learn what is recursion stack and how it uses space in recursive programs.

Resources :

Phase 8 : Learn Searching & Sorting :

Linear search

Sorting

  1. Selection Sort
  2. Bubble Sort [ optional β€” nice to learn]
  3. Insertion Sort
  4. Merge Sort ( Requires Recusion to implement )
  5. Quick Sort
  6. Heap Sort ( optional β€” may keep this for later )
  • In built sorting algorithms in languages i.e. cpp, java, python

Resources

Practice Problems

Tips

  • Don’t rush for learning all sorting algorithms, but try to understand them
  • Try to use inbuilt sorting most of the time when you are solving problem.

Binary Search

  • Note : Binary Search can only be applied on Sorted Array / Data Structures. [ function needs to be monotonic in order to apply Binary Search ]

Resources :

Other Variations on Binary Search :

Practice Problems :

Phase 9 : Learning Linear Data Structures

Learn linkedlist, stack and queue

Linked List

Stack

Queue

Important Note for data structures :

  • STL Library implementation of data structures C++
  • All data structures are readily available like vectors ( array ) , stack, queue, list , linkedlist, priority queue in all languages.
  • So learn and implment only for learning purpose
  • while problem solving use ready made data strucutres
  • For example libraries like C++ STL , Java Collections, and same for python.

How to Learn any topic :

  • Search your topic name on google, i.e. stack on geeksforgeeks
  • Read and understand the implementation code of stack from geeksforgeeks
  • Try to implement it on your own without copying.
  • Test your code by solving some problem related to this topic on leetcode / geeksfogeeks.

Inbuilt data structures and algorithms :

  • Learn Standard Template Library in C++, or in java Collections, or similarly for python.
  • C++ STL Tutorial, Java Collections Tutorial
  • Learn about Vector, Map, Set.
  • For running and writing programs you may use IDE like VS Code, Sublime Text, or any online ide like Jdoodle.

Phase 6 : Start solving Greedy Problems

Greedy

  • This is not an algorithm, it is strategy.
  • Greedy is human way of thinking in order to reachout the solution.
  • problem types includes, searching , sorting etc. any greedy strategy to reachout solution.
  • Actually Sorting and Searching are at the end Greedy only.
  • Greedy Tutorial Striver
  • Leetcode Greedy Problems

Sliding Window

Two Pointer

Phase 9: Learn Recursion

Recursion is calling function by itself, is the great stregth to solve difficult problems easily

Recursion by Sanket Singh Part -1, 2 and 3

geeks for geeks recursion

Practice Problems :

learn divide and conquer technique in that recursion is heavily used there.

Backtracking :

Phase 10: Contests and Competitions

Contest is competition of competitive programming

  1. codeforces
  2. leetcode
  3. geeksforgeeks
  4. codechef
  5. Atcoder

They hosts regularly contests on weekly/ biweekly/ monthly basis

  • Calendar for contests : https://clist.by/ If you perform better your rating will increase and vice versa
  • These platforms ratings matters sometimes in your interview, offcampus and oncampus shortlisting for placements.
  • Contests gives you expirence on time pressure.

Recommended contests :

  1. Leecode weekly and biweekly ( for placement & competitive coding )
  2. Codeforces div 2,3,4 ( for competitive coder folks )
  3. Atcoder beginner Contests ( for beginners and intermediates )
  4. Geeksforgeeks weekend contest ( Just to keep momentum )
  • Apart from above there are some other like Meta Hackercup.

So what you are waiting for just start competing.

Phase 11 : Hashing

Practice Problems :

Phase 12 : Tree

Usually Tree is extension of linkedlist / vector

Trees : 1. Binary Tree

  • Each node in tree has left &/ right children.
  • tree traversal , preorder, inorder and postorder
  • recursively solving tree problems
  • concepts like what is subtree, leaf, root and all.
  • Solve tree problems on leetcode and geeksforgeeks

Practice Problems :

2. Binary Search Tree

  • Binary Search Tree is Binary Tree in the order of values of nodes.
  • Inorder traversal gives you sorted values.
  • Binary Search idea comes from here only.

Practice Problems :

CSES Tree Algorithms Problems

Tree Problems by Om Ashish Soni

Solve above topics on leetcode, geeksforgeeks, ( codeforces β€” for competitive coders )

There are also other type of trees like rooted ( n-ary ) , un-rooted ( n-ary ) tree.

Phase 13 : Heap, Priority Queue, Dijsoint Set

Heap and Priority Queue ( Priority Queue is implemented using heap )

Practice Problems :

Dijsoint Set Union ( DSU ) :

Pracitce Problems :

Phase 14 : Graph

  • Node, Edge, Cycle, Loop, Path, in graph.
  • Directed, Undirected, Asyclic Graph,
  • Memory representation ( data structure ) of graph
  1. Adjacency Matrix

  2. Adjacency List

  • Bredth First Search ( BFS ) , Depth First Search ( DFS )
  • DFS is most useful
  • Single Source Shortest Path ( Dijsktra , Bellman Ford )
  • All Shortest Path ( Floyd Warshall )
  • Dijsktra is very usefull
  • Minimum spanning tree in graph ( Prims, Kruskal Algorithm )
  • Prims, kruskal, connected componenets of graph
  • kosaraju algo, articulation points of graph ( tarjans algorithm )
  • priority queue and dijsoint set union if you can learn will help more to solve these graph algo problems

Phase 15 : Dynamic Programming

Ooooppps ! the most obsessfull topic you may think

Actually its very easy to solve and implement if you know it and hands on it.

If you don’t remember the past, you are condemned to repeat it.

  • Overlapping subproblems property
  • We decompose the problem in smaller subproblems and then we solve sub problems and reusing already stored solution.
  • DP problems are optimization problems like minimizing, maximizing,
  • DP is also used with combinatorics which we will see later.
  • DP can be combined with any topic, binary search, string, graph, tree any thing.

There are 2 types of DP :

  1. Tabulation ( Iterative β€” Tabular ) β€” Easy to solve and implement in longer time, more widely used
  2. Memoization ( Recursive ) β€” Good to start with

Great start for dp ( don’t focus on language of video , focus on topic )

[takeuforward - Best Coding Tutorials for Free

takeuforward is the best place to learn data structures, algorithms, most asked coding interview questions, real…

takeuforward.org](https://takeuforward.org/dynamic-programming/striver-dp-series-dynamic-programming-problems?source=post_page-----09789df3df55--------------------------------)

Combinatorics :

Phase 16 : And more advanced topics and data structures algorithm

[Competitive Programming - A Complete Guide - GeeksforGeeks

A Computer Science portal for geeks. It contains well written, well thought and well explained computer science and…

www.geeksforgeeks.org](https://www.geeksforgeeks.org/competitive-programming-a-complete-guide/?source=post_page-----09789df3df55--------------------------------)

How to Read a Problem?

  1. Pay Attention to Problem Statement: Take extra care to read the problem statement correctly. Mistakes in understanding the problem can lead to wrong solutions. For example, distinguishing between β€œundirectional” and β€œunidirectional” graphs (undirected vs directed) can significantly impact the approach.
  2. Analyze the Constraints: Understanding the problem constraints can provide valuable insights into choosing the appropriate algorithms and data structures to solve the problem effectively.

Tips for contests and competitive programming

  1. Stuck in a Contest: If you feel stuck during a contest, take a short break of 1 or 2 minutes. Wash your face to refresh yourself and then start again with a clear mind.
  2. Can't Improve: If you're struggling to improve, try upsolving. If you can't come up with any ideas, refer to the editorial. If there is an unfamiliar topic, learn it and repeat this process.
  3. How to Boost Performance: Participating in long challenges on Codechef can help boost your performance and allow you to learn various tips and techniques.
  4. Combining Different Approaches to Solve Problems: When faced with a problem, try multiple approaches. For example, if it's a graph problem, start with DFS. If that's not enough, try using disjoint sets. If there's a need for path compression, use it. If the constraints allow, consider using Fenwick trees. This approach helps you combine different techniques to solve problems effectively.
  5. Difficulty with Last 3 to 4 Problems of a Contest: If your basics are clear, practice a lot of problems related to trees, graphs, dynamic programming, and segment trees until you feel satisfied.
  6. Where and How to Practice:
  • Hackerrank is a good platform for beginners to learn a programming language.
  • Once you have a basic grip on a language, move to the problem set on Codeforces.
  • Solve problems on Codeforces with ratings below 1000.
  • Practice problems based on specific topics from the Codeforces problem set.
  • Participate in contests on Codeforces and Codechef.
  • Upsolve problems. If you can't solve a problem within 30 minutes, refer to the editorial. Learn any unfamiliar topics and repeat this process.
  • As your rating improves, continue step 4 and solve problems within the rating range of [your rating - 100, your rating + 100].
  • Keep learning new algorithms and practice implementing them.
  1. How Problem Setters Find New Problems: Not all problems in contests are built from scratch. Many problems are a mixture of multiple problems from resources like the CSES Problem Set.
  2. Getting TLE with String as a Key in Ordered Map: If you're experiencing performance issues with a string as a key in an ordered map, try using a hash map instead. This change may improve the performance.
  3. IDE Recommendation: In competitive programming, it's recommended not to use an IDE. Instead, develop a habit of using a text editor like Vim, this is optional you may avoid it.
  4. Which Template Should I Use in CP?: There are various templates available for competitive programming. You can refer to the following resource for templates that are useful in competitive coding: Templates Useful for CP
  5. Tips to solve Constuctive :
  • Writing a brute force script rather than manual solving
  • Finding a pattern
  • Coding optimized solution corresponding to pattern
  • Taking care of edge cases.

Basic Constraints and Safe Time Complexity

captionless image

Follow Om Ashish Soni, for more such content.

If you have any questions or would like to collaborate, reach out to me. I’m always excited to discuss new ideas and opportunities.

Disclaimer:

The codes provided in this repository are written based on my personal preferences. Although they are public, I continue to use this repository for participating in contests. Therefore, please ensure that you take appropriate measures to protect your code against plagiarism.

Starter Contests for Beginners

Contests for Newcomers
Contest 1

Websites for Interview Preparation

DSA and Interview Preparation
LeetCode
GeeksForGeeks
InterviewBit
CodingNinjas
Binary Search (currently down)

Golden Resources for Learning

Useful resources for learning
Good Tutorials for Competitive Programming
EKZLib

Awesome Contest Tools

Handy tools for contests
Graph Editor - CSAcademy
OEIS - The On-Line Encyclopedia of Integer Sequences

Codeforces Tools

Helpful tools for Codeforces
Codeforces Randomizer
Codeforces Predictor
Codeforces Practice Tracker
Codeforces Enhancer
Carrot Rating Predictor
Stopstalk
Codeforces Recommender by CodeDrills
Profile Comparator
Codeforces CLI
CP Editor

Note to Myself

  1. AtCoder Standings
  2. Codeforces Contest List
  3. Virtual Judge
  4. Codeforces Profile Comparator
  5. USACO Contests Guide
  6. Codeforces Recommender by CodeDrills

C++ Tricks

  1. Codeforces - C++ Tricks
  2. Codeforces - Useful C++ Tricks
  3. Codeforces - C++ Optimization Techniques
  4. Codeforces - Cool C++ Features
  5. C++ Reference - cppreference.com
  6. LearnCpp.com - C++ Tutorial

Advanced C++ Guides

  1. USACO Guide - Generic Code
  2. USACO Guide - Lambda Functions

Python Tricks

  1. GeeksforGeeks - Differences Between Python 2.x and 3.x

Java Tricks

  1. Java Programming Guide - PDF

How to Read a Problem?

  1. Pay Attention to Problem Statement: Take extra care to read the problem statement correctly. Mistakes in understanding the problem can lead to wrong solutions. For example, distinguishing between "undirectional" and "unidirectional" graphs (undirected vs directed) can significantly impact the approach.

  2. Analyze the Constraints: Understanding the problem constraints can provide valuable insights into choosing the appropriate algorithms and data structures to solve the problem effectively.


Courses

  1. T-414-AFLV Course
  2. Codeforces Educational Courses
  3. KTH Competitive Programming

Implementations

  1. Om Ashish Soni's Competitive Programming Repository
  2. KTH Competitive Programming Repository
  3. USACO Implementations by Benjamin Qi

Other Resources

  1. VisuAlgo - Visualizing Algorithms and Data Structures
  2. Topcoder Data Science Tutorials
  3. CS97SI - Introduction to Competitive Programming from Stanford University

Practice Websites

  1. Codeforces Problemset
  2. AtCoder Contest Archive
  3. Saraswati Online Judge
  4. CodeChef
  5. HackerRank Dashboard
  6. CSAcademy Contest Archive
  7. TLX - Toki Learning Center
  8. Kattis Open

Tag-wise Practice

  1. CSAcademy Tag-wise Practice
  2. Saraswati Online Judge Tag-wise Practice

Practice Guides

  1. USACO Guide - Practicing
  2. Codeforces - Guide to Problem Solving
  3. Informatics Notes - Preparing for Contests

Input Output Guides

  1. Codeforces - Input/Output Guide

Debug Guides

  1. KTH Competitive Programming Repository - Troubleshooting
  2. Codeforces - Debugging Guide

Other Tools

  1. Desmos Calculator
  2. DiffChecker - Compare Text Diff
  3. Geodeb - Geometry Debugger

Important Books

  1. Programming and Problem Solving (PAPS) by USACO Guide
  2. Competitive Programming Handbook (CPH) by USACO Guide
  3. Competitive Programming in C++ by Darren Yao

Common Advice

  1. Practice on Codeforces: Solve a lot of problems on Codeforces that are just above your current rating range.
  2. Prioritize Codeforces: Codeforces is the best platform to improve your competitive programming skills, so spend a significant amount of time on it.
  3. AtCoder: Participate in AtCoder Beginner Contests, which are suitable for beginners and provide valuable practice. You can also try AtCoder Regular Contests.
  4. Codechef: Use Codechef for math and bit manipulation questions.
  5. Codechef Starters Contests: Participating in Codechef Starters Contests can be beneficial.
  6. LeetCode: Solve LeetCode Weekly and Biweekly Contests for practice and warm-up. These contests often have a mix of easy and medium difficulty questions, which can boost your motivation.
  7. Awesome Resources: Explore the following resources for inspiration and motivation:

Tips

  1. Stuck in a Contest: If you feel stuck during a contest, take a short break of 1 or 2 minutes. Wash your face to refresh yourself and then start again with a clear mind.

  2. Can't Improve: If you're struggling to improve, try upsolving. If you can't come up with any ideas, refer to the editorial. If there is an unfamiliar topic, learn it and repeat this process.

  3. How to Boost Performance: Participating in long challenges on Codechef can help boost your performance and allow you to learn various tips and techniques.

  4. Combining Different Approaches to Solve Problems: When faced with a problem, try multiple approaches. For example, if it's a graph problem, start with DFS. If that's not enough, try using disjoint sets. If there's a need for path compression, use it. If the constraints allow, consider using Fenwick trees. This approach helps you combine different techniques to solve problems effectively.

  5. Difficulty with Last 3 to 4 Problems of a Contest: If your basics are clear, practice a lot of problems related to trees, graphs, dynamic programming, and segment trees until you feel satisfied.

  6. Where and How to Practice:

    • Hackerrank is a good platform for beginners to learn a programming language.
    • Once you have a basic grip on a language, move to the problem set on Codeforces.
    • Solve problems on Codeforces with ratings below 1000.
    • Practice problems based on specific topics from the Codeforces problem set.
    • Participate in contests on Codeforces and Codechef.
    • Upsolve problems. If you can't solve a problem within 30 minutes, refer to the editorial. Learn any unfamiliar topics and repeat this process.
    • As your rating improves, continue step 4 and solve problems within the rating range of [your rating - 100, your rating + 100].
    • Keep learning new algorithms and practice implementing them.
  7. How Problem Setters Find New Problems: Not all problems in contests are built from scratch. Many problems are a mixture of multiple problems from resources like the CSES Problem Set.

  8. Getting TLE with String as a Key in Ordered Map: If you're experiencing performance issues with a string as a key in an ordered map, try using a hash map instead. This change may improve the performance.

  9. IDE Recommendation: In competitive programming, it's recommended not to use an IDE. Instead, develop a habit of using a text editor like Vim.

  10. Which Template Should I Use in CP?: There are various templates available for competitive programming. You can refer to the following resource for templates that are useful in competitive coding: Templates Useful for CP

  11. Tips to solve Constuctive :

    1. Writing a brute force script rather than manual solving
    2. Finding a pattern
    3. coding optimized solution corresponding to pattern
    4. Taking care of edge cases.

Improving Sorting (Ruffle Sort Inspired from Second Thread's Code)

Here's an implementation of the Ruffle Sort algorithm inspired by code from the second thread:

static void ruffleSort(int[] a) {
    int n = a.length; // Shuffle, then sort
    for (int i = 0; i < n; i++) {
        int oi = random.nextInt(n);
        int temp = a[oi];
        a[oi] = a[i];
        a[i] = temp;
    }
    Arrays.sort(a);
}

codechef Roadmap

  1. start with array -> practice -> 2 🌟
  2. learn c++ stl or any language similar library, dp -> 3 🌟
  3. disjoint set union , graph, little dsa -> 4 🌟
  4. segment tree -> 5 🌟
  5. Codechef has very nice problems on Bit manipulation So , making good grip over bit manip can help in contest.

Codeforces Suggestion

  1. Codeforces requires speed of solving problems.
  2. Even if you solve only 2-3 problems , but very quickly then , you will get fruitful ratings.
  3. Upsolving is required since the problem pattern might be repeated in future problems.
  4. First two questions are mostly greedy in div -2,3,4 contests. No prior knowledge except programming language is required.
  5. Below is example how upsolving looks like cf upsolving

Troubleshooting Error on Codeforces for Java

If you encounter the error "Source should satisfy regex [^{}]public\s+(final)?\sclass\s+(\w+)" while using Java on Codeforces, follow this guide to resolve the issue: Troubleshooting Java Error on Codeforces

Python: Jumping by 2

You can easily jump by 2 in Python using the range() function with a step size of 2. Here's an example:

for i in range(0, 10, 2):
  print(i)

Lesser-known Resource

Discover a lesser-known resource that can enhance your competitive programming skills: Heap using STL in C++

Avoiding Recursion Depth Problem in Python

To avoid recursion depth problems in Python, you can increase the recursion limit using the following code:

import sys
sys.setrecursionlimit(10**6)

Useful C++ Tricks

Explore a collection of useful C++ tricks to enhance your programming efficiency: C++ Tricks on Codeforces

Feel free to explore these resources to overcome common challenges and improve your competitive programming skills.

README

Welcome to the repository! This README file provides important information and resources related to the project.

Roadmap

You can find the roadmap . It outlines the planned features, milestones, and overall direction of the project.

Codeforces Blogs

For additional information and insights, you can refer to the Codeforces blogs . These blogs cover various topics related to competitive programming and can be a valuable resource for learning and improving your skills.

Note to Self

Please keep in mind the following points:

  • Number theory, bit manipulation, and dynamic programming (DP) are among the most popular topics in competitive programming.
  • In 98% of the contests, at least one of these topics is always included.
  • It is essential to practice these topics extensively to improve your proficiency.

Basic Constraints and Safe Time Complexity

N Big O
For N <= 10 O(2^N) and O(N!)
For N <= 100 O(N^3)
For N <= 10^3 O(N^2)
For N <= 10^5 O(NLogN)
For N <= 10^6 O(N)
For N <= 10^9 O(logN)


nice youtube channels :

channel
Tushar Roy
Striver
CodeNCode
Tech-Dose
Luv
Apna college Placement course
Errichto
William Lin
William Fiset
Algorithms live
benritmicocode
jonathan paulson
Second Thread

Other Nice Repositories

Repository
Code Library by Shahjalal Shohag
Tourist
William Fiset Algorithms
CP by Dhiraj-01
CP-Library by Dhruv Gheewala
Coding Library by Huzaifa
Competitive Coding by Ashish Gupta
Shahjalal's CP Library
Coding Notes by Ankit Priya Rup
Leetcode Questions by fterh
Algo-lib by Saketh Are
Coding Notes by Ankit Priya Rup
Atcoder Library
Competitive Programming by Alexandru Valeanu
CSES by superj6

Important Topic References

Topic Reference Link
Dynamic Programming Video
Mathematics for DSA & CP Video

Helpful Articles

Article Reference Link
Roadmap for Competitive Programming
Modulo Multiplicative Inverse
Random Shuffle

Important Links


Good to Know

  • At maximum, a number can have O(2*sqrt(n)-1) factors, which is the upper bound for the number of factors.
  • A leaf node is a node with a degree less than or equal to 1.

Guides for Writing Clean Code

  1. Google C++ Style Guide

Please refer to the respective links for more information and resources related to coding, competitive programming, and problem-solving.

Vim Configuration

To configure Vim for competitive programming, follow the steps below:

  1. Open the terminal and enter the command: vi ~/.vimrc
  2. Paste the following configuration code into the file:
set number
set tabstop=4
set shiftwidth=4
set autoindent
set mouse=a
colorscheme default
autocmd vimEnter *.cpp map ^B :w <CR> :!clear ; g++ --std=c++17 %;if[[-f Output : ++++++++++++++++++++++++++++++++] a.out ];time ./a.out; rm a.out; if[[-f End : --------------------------------]a.out]<CR>
  1. Press Ctrl+C and then Ctrl+B to compile and run the code.

About

This repository is collection of lot of problems tag wise and their solution coded to help other users, also this contains lot of ready made modules for cp

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published