Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

Okay!

To begin with Competitive Programming:

Prerequisite: You need to know Basics of any Language. In my opinion you


should start with C/C++.

1. SPOJ( A good problem Archive for all beginners) 2. HACKEREARTH 3.A2OJ


4.LEETCODE....

* Start with problems having maximum submissions.


* Solve first few problems (may be 20).
* Build some confidence.
* Then start solving problems topic wise.
* Never get stuck for too long in the initial period.
* Google out your doubts and try to sort them out or you can discuss with
someone (ONLY IN THE BEGINNING).
* Even if you are unable to solve a problem do always look at the
editorials and then code it and get it accepted (this is the way you will
learn).

Now,how to start:
* Analyze the problem.
* Breakdown into smaller sub-parts.
* Write your solution or algorithm on paper.
* Dry run the code.
* Write code.

One thing you remember in OJ there is a concept of Time Limit, Memory


limit...so it's important to analyze the constraints.

MATHS FOR CP:


Number theory:
*Prime Check ( O(log n) also possible read about miller-rabbin )
*Factorization
*Number of factors
*Sum of factors
*Generating Primes using sieve of eratosthenes
*Bounds on number of primes till N
*Euler’s totient function

NOW IMPORTANT WEBSITES WHICH WILL HELP YOU IN CP:

* geeksforgeeks
* OEIS.org(for sequence related questions)
* CP-Algorithms
* There is CP Handbook:https://cses.fi/book/book.pdf here...You must
download it.

...And yet there is much out there to learn...


(BUT THE ONLY MANTRA IS PRACTICE1!!)

***********************************************PRACTICE!PRACTICE!PRACTICE
!****************************************************

You might also like