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
C++
Competitive-Programming-by-om-ashish-soni
Disclaimer :
The codes are written for my suitable choice.
Eventhought public, this repository is still being used by me for participating in contests. So make sure you take care of your code for plagiarism.
1. Sometimes doing mistake in spelling of problem statement. i.e.
undirectional graph vs unidirectional graph.
(undirected vs directed)
So it is very essential as well as necessary to read problem statement correctly.
2. Have a look at constraints , from that idea of which algorithm to apply , can be derived.
1. Practise a lot problems on code forces of just above your rating range.
2. Codeforces is only the site that will improve competitive programming , so give priority and spend a lot of times on it
3. Next is atcoder , give atcoder beginner contest are really nice for beginners and to practise.
4. You can also give atcoder regular contest.
5. Use Codechef for maths and bit manipulation question.
6. You can give codechef starters contests are good.
7. Leetcode weekly and biweekly can also be given in order to practise as well as warm up, since 3/4 questions are easy and medium , so it will improve your motivation.
take 1 or 2 min break, wash face and start again with freshness
2. can't improve :
try to upsolve, no idea comming see editorial and if un-none topic learn it, repeat this
3. how to boost performance:
always and almost long challanges on codechef helps to boost performance and learn various tips and techniques
4. how to combine different approach and solve problem :
let's say there is a problem and you performed below steps
1. the problem is of graph , dfs -> not enought to solve a problem ?
2. using disjoint set -> yes -> but tle
3. using path compression -> yes -> but wrong answer on some edge case
4. oh , look at the constraints , can we use fenwick tree? yes -> Solved -> AC
these are the steps that how to combine different approaches
5. Can not solve last 3 to 4 problem of contest :
If your basics are clear , then you need to practise a lot of problems of tree,graph,dp, segment trees,
until you feel satisfied enough
6. Where and how to practise :
1.always hackerrank is good to learn a language for beginners
2. after having little grip on 1 language, go to codeforces problem set
3. on codeforces problem set solve problem of rating < 1000
4. solve topic wise problem on codeforces problem set
5. give contest on codeforces and codechef
6. upsolve problems , if can not solve in 30 mins , see editorial, if unnone topic , learn it, and repeat this
7. after rating growth, repeat step-4 and solve problems of rating range [your rating -100 , your rating + 100]
8. keep learning new algo and practice them
7. How problem setters every time finds and puts new problem in contest :
see , its not that every problem was built from scratch ,
most of the problems in contests are mixture of more than one problem of below cses sheet.
8. Getting TLE while using string as a key in ordered map ?
Try to use it with hash map, might performance be improved.