Hello there. I would like to share my experience on how I reached Expert in my first 6 months. A few people asked me about that so I am writing a blog for everyone to see and the techniques I used to reach expert in 6 months. I started Competitive Programming 8 months ago. I didn't know except some basics about visual basic programming language and I didn't know except to do some GUI and write basic code. I was introduced to CP and how important it was from university admissions to job interviews. I began to learn step by step new ideas, new algorithms etc... From my experience, I would like to share those important tips from my point of view:
Always train CP with a target. This really helps you to train and read articles(like implementation and algorithms and maths) to reach your target as fast as possible
Train with your friends. Training with your friends and trying to out perform them.
Always take rating seriously and compete online in many sites. Rating sometimes doesn't mean your real performance. Your real performance sometimes might be worse or better than your rating but it won't be further than +100/-100. If rating was to be taken seriously, you would try your best to solve the problem within the contest and prevent rating loss.
Always expect a reward. Even if the reward would take a long time or it would be small, expecting a reward is a really good boost for you to train.
Learn new algorithms and data structures. Learning them is very important(for example DFS,segment trees,Dijkstra,etc...). Mathematics is also very important(especially forming equations,number theories,combinatorics,etc...)
Don't solve too easy problems. Solving too easy problems won't make you get better. Also, you should solve on the topics you are weak on and solve randomly(random solving problems a little bit higher than your rating is one of the best practicing techniques!)
Always try to solve problems you don't get during a real contest. That would teach you new techniques and ideas you missed to think about during the contest!(Suggested by baguettes)
You should like competitive programming. Most of the time if you like a subject, you would be good at it!(Suggested by baguettes)
Check the editorial if you failed. Failing is part of the training. Even if you find that you fail a lot, failure will turn to success after you learn the new ideas/techniques/ways of thinking. Most importantly, you should check the editoral if you failed to solve the current problem.
Here is an awesome design made by journey (Thank you for such a great design! You are really talented my friend):
I hope those tips help. I also thank JoeSherif AnasAbbas Shalaby for helping me through the training and practicing! Also, I was inspired by Benq's rating and how he became LGM in only 3 years showing that nothing is impossible! Thank you for such an inspiration!
If you have any questions, ask me at anytime! Good luck everyone!
Learn new algorithms and data structures. Learning them is very important(for example DFS,segment trees,Dijkstra,etc...).
This step is not necessary for becoming expert. Segment tree? Dijkstra? What?! I think you over-complicated div 2 A to C by infinitely many folds.
Also, I think you missed the most important step: Take part in Div 3 contests only.
Well, maybe segment trees are not needed for the beginning of expert. But I am sure something like DFS is very important same for Dijkstra. Maybe it is not needed at the beginning as codeforces writers don't put a lot of data structures in div 2 A to C, but it will be important the step after it. What I am trying to say is to keep everything balanced and practice on everything. It might be a bad idea to be very skilled in greedy problems and perform poorly in data structures problem. There must not be a big gap between those or else, reaching the step after it(Candidate master) might be really hard!
Edit: Take part in division 3 only? Are you serious? That is a really bad idea! I'd say division 2 is way more challenging than division 3. Also, division 3 don't happen except like once per week. A person should participate in online contests way more than that!
There must not be a big gap between those or else, reaching the step after it(Candidate master) might be really hard!
Pick one of the above.
I don't think reading an article and practicing some few data structures will really consume your time. Also, in few cases, some problems have another solution other than the main solution. Maybe the person couldn't get the main solution? But he might be able to get the other approach that might be harder and require data structures and algorithms. Learning new stuff doesn't hurt especially that it will be used in the future!
Learning new stuff doesn't hurt especially that it will be used in the future!
I don't think you understand how Competitive Programming works. Competitive Programming is not about coding a monstrous 500 line solution (filled with clever algos and data structures) for a problem that requires a 5 line solution. And honestly, how many times have you seen div 1 level stuff being asked in div 2 A, B and C?
Sure. You can over-complicate stuff by throwing in all the advanced data structures and algorithms for a simple div 2A. But how long's that going to take you to code? The key here is to use the simplest solution that works (i.e. gets AC). No one cares about anything more than that.
In some rare cases, a person might find that simple solution complicated. Everyone's brain is different. I will give you a very simple example of a combinatorics problem that can be solved DP. Some few people find that getting a combinatorics equation is easier than getting a DP solution. Others find that writing a DP solution is a lot easier than getting a combinatorics equation. Everyone is different and you cannot change that fact! Yes, you are true. Thinking about the simplest solution is the target of CP. But in some few cases, you need to over complicate the solution to solve the problem. Over complicating a solution and solving it is better than just leaving it and not solving it at all!
But in some few cases, you need to over complicate the solution to solve the problem. Over complicating a solution and solving it is better than just leaving it and not solving it at all!
If you need to over-complicate stuff. You are likely doing it wrong. And insisting on doing the wrong way is an absolute waste of time.
Some few people find that getting a combinatorics equation is easier than getting a DP solution. Others find that writing a DP solution is a lot easier than getting a combinatorics equation.
Sure. You can use different methods to solve a problem. BUT, some methods are just not useful in Competitive Programming. Learn to filter out the useless ones (e.g. writing over-complicated code).
hes rigth learning some algorithms like data structures will bann your mind and you cant solve them with easy solutions like stack trick
For me learning crappy stuff did waste my time, I was dumb because I thought some data structure or a fancy algorithm would help me solve things. I performed much better by instead just doing problems that appear in contests instead of learning random stuff hoping it would help me someday.
Useful advice! The part that it will be used in the future!!
Is there any article/blog which divides the topics into rating category? I mean I want to know what are the required DS to be on a certain rank.
Look, I was a newbie but when I ignored the rating and entered every single round I became specialist as I started to convince myself that if I deserved to have a higher rating I will have a higher rating so I entered every contest with this thought till I became specialist.
I was a newbie but when I ignored the rating and entered every single round I became specialist
Specialist rank isn't really anything to be proud of. Typical specialists still struggle at div 2 A, B and Cs.
I am not proud, but I am just glad that I became a higher rating after about two years of being newbie. xD
you are unrated
Do you understand the pain of being stuck in newbie role?
Been there. Done that. That's why I know the mindset of typical div 2 coders.
what is your current rating?
What's your guess? ;)
Most of the tips given to beginners are same,I guess the only thing that really works is hard work and practice.
A very cool article, but there are two important things as well, which are the speed of the solution and the testing of the code before it is submit, I believe that its acquisition depends on the number of problems solved and the difficulty of these problems, good luck, and thanks for this article.
You are right,the main problem faced is speed also,for the first two/three questions in Div 2 simply time taken makes a big difference.
No No No. Speed is not even the problem. Believe it or not. Even if a div 2 contest were 20 hours long instead of 2 hours, many green/gray/cyans will still be stuck at solving problem A/B, not because they are slow at implementation. But simply because they did not get the correct solution in the first place.
Sometime i get the idea sometime not, how does higher rated people get the idea/trick behind div2 A,B,C every time and even so fast, now for that should i blame my brain or there are some ideas which repeats(in some form or other) which after practice i can master? if so how much practice?
One mistake I often did when I was a beginner was that I would often over-complicate stuff. Just think about the "simplest way" to reach the solution-this philosophy works for div 2 A and B , sometimes C. Just think out some math, greedy,etc and it works most of the times. Don't get too worked about it, sometimes Div 2 A and B are indeed harder than usual. As for the practice method, just practice a bunch of Div 2 A and B , say, from the last 20-30 contests. That would suffice
Yeah, I agree. Usually, Div2 A and B are designed to be really easy (they were too in the round a few hours ago, I just missed the easy solutions). For practice, doing Div2 A and B problems from previous rounds is really good, but a very good site to learn cp is https://usaco.guide. I strongly, strongly recommend going over the problems in that guide, it was made by some of the top programmers. The ordering of the problems is based on USACO divisions, but you can think about them like this (I've edited this now that the difficulty has changed over the past year; see edit history for the previous comments, also don't take this too seriously):
USACO Bronze: Div2 A-C
USACO Silver: Div2 C-E
USACO Gold: Div1 A-C
USACO Plat: Div1 C-E (Plat is insane)
If you are able to solve most of the bronze problems, you'll get a feel for how problems are structured and can get an idea of what the intended solution is.
Do you advice me as a beginner to stop training in codeforces and start training in usaco , Does it better for me, I have two years remaining to join in ioi, witch is the best resource?
Everywhere I've seen that to improve, where you solve problems doesn't really matter; it's hard work and dedication to solving hard problems that force you to think of new ideas that make you improve.
Now to answer your question, I find that Codeforces values speed more while USACO requires being able to solve harder problems. If you want to go to the IOI, you need both skills, so a combination of these should be good. You can find a lot of great resources online like
(off the top of my head)
Why do people care so much about coding interviews and CF ratings and rewards and targets? Learn for the sake of learning new and interesting things!
Yeah the main idea is learning,but still rating/rewards give encouragement and motivates you to do better.
Why should everyone be like that? Can't people just have their own reasons? Even if it's about rating.
BTW, the answer to your question is People care about interviews because it's gives them a job. People care about rating because it measures their performance and a show-off. Why should anyone care about learning if it isn't useful in some way? By useful I mean gives them some rating or job or money or whatever. Everyone doesn't have a be a knowledge freak or a nerd.
In my experience the people who obsess over job interviews but have no passion are not the ones who achieve high rank.
I think passion comes when you are already somewhat good. I believe you can become passionate about almost anything if you are made to think that you are good at it.
When I started competitive programming, I wasn't good so I had little passion. I did it for getting better at programming for some interviews or jobs in general. But as I got better than most people around me, I gained pride in myself and passion for competitive programming.
Yes, people at the very top are very passionate, but you don't have to be some really passionate person to get into div1. And getting into Div. 1 is already enough for most people.
So in short, you don't need to be crazy about learning to perform at somewhat reasonable levels. But that becomes important if you want to be on the very top.
You would find a lot of CP coders who now do coding even in being job and actually was not passionate when they started. With the increase of their rating, they became passionate. If I get struck in some region, then I might not get interested in that thing anymore.
If you don't enjoy learning there's nothing wrong with that. Doing things for prestige and/or money is just as (more) reasonable then doing things for the sake of learning. Plus, people who care about rating or equivalent usually end up learning more because they have a more set goal to achieve and actually do the stuff necessary to achieve it.
I used to learn just for the sake of it but now I learn for contests, and I push myself way harder and see a lot more interesting techniques than I did before.
bro i m really stunned like u have solved only 80 problems and became a specalist ,how do u practice in such a smart way .can you give some tips to a nebie coder .
He registered 2 years ago when everyone's initial rating wasn't 0 , It was around 1500.
its really painful to code. just doing it for getting placements.
Perhaps look for a job you would really enjoy doing ?
Cong. but why not solving easy problems? sometimes there is something very nice in Div.3 contests, i usually try to full them and then read the editorial even for Div.3 A problem, also solving easy problems will increase your coding speed, try solving them in less than a minute if they are too easy, being able to code fast is important.
Also simple implementations will help you get used to CP, sometimes it happens that you solve Div1.C in a second but you cant bring it to your codes, its because of that you are not fine enough in implementation.
You are definitely right! But some people get used to only solve easy problems and not try to solve harder problems. Solving a few would also be really good idea! Plus, it would train your mind to simplify solutions if it was complicated for Div 2 A/Div 3 A. I only feared that people might get used to solving easy problems so I didn't write it in the blog.
Yes you are right, i didn't mean to leave skip the hard problems, solving hard problems increase your coding skills and solving easy problems will makes you faster and more experienced.
Ahmadsm2005 Did you solved majority problems on Codeforces only or anywhere else as well? Asking so I can compare your stats with mine on cfviz.
Well, I solved 441 problems in total. Basically, I aim to speedforce problems that have the same rating of mine or a little bit lower and to try as much as I could to solve higher rated problems. This balance brings fast thinking(speedforces), solving harder problems(like div 2 D for me).
Congrats on your improvement!
Let me add two more tips:
always try to solve problems you don't get during a real contest. That is how I learned a lot of techniques and tricks I otherwise would have missed.
you have to like this stuff!
Thanks! You are right! I will edit the blog and add your points as it seams really reasonable! I will also add a point to check editorial if you couldn't solve the problem.
I can completely relate with you. I wasn't really passionate with CP till this April. I was not a regular contestant at all unlike you. I began my CF journey from late 2018 but quited. I also became active again in late 2019 and quited again. Then, I began my real journey at Feb2020. Learned algorithms like Binary-search, greedy, dynamic programming. I also improved in STL. Solved decent numbers of problems in CF and SPOJ and came back to contest in April,2020. If you see, my first contests of April was depressing.
What I am trying to say, participate in both rated and unrated contests regularly as much as possible. It would increase your level and you wouldn't understand how. 60-70 qualityfull SPOJ problems seemed less effective than participating 5/6 contests. So, do virtual contests too. It would be super effective. I don't know how. But, it would be.
Wow awesome! You did a great job! Good luck in your next step!
You have done quite a great job. A lot of submissions in just 6 months. You are surely going to be a CM quickly.
I also want to become CM in 4-5 months, and I am regularly giving all contests and upsolving div2 till D and div3 till E sometimes F. Please advise me is random practicing of problems of higher rating than your current level good or I need to know topics like segment and fenwick trees too?
You need to know at least Fenwick's tree. You also need to speedforces A,B,C,D div 2. You also need to know combinatorics. Random solving when there are no contests running is one of the best practicing techniques(solving problems a bit higher than your level for example, if your rating is 1600, solve some 1700 and a lot of 1600. If someone's rating is 1600, it shows that they can solve 50% of 1600 prpblems.)
Thank you so much for replying. I will continue practicing 1700+ problems. I am quite comfortable with 1600 and 1700 but need to improve my speed.
It's not exactly like that, if your rating is 1600, you can solve upto 2000 level problems(even more). You just need time. Taking some problems like that in any day(4/5 days in month probably) would be fun and also educative too. And you have to able to think out the solution. Now, you see D's and even E's need just basic algos like dp, bfs, dfs. So, it's observation skills which matters most.
Thank you! Good luck for you too!
One of the crucial points: "Always expect a reward" I think is very important. For me personally I spent quite a bit time in a plateau until one day I saw significant increase in my rating. I guess moral of the story is to not get discouraged!
While it is good mindset to get better, sadly it doesn't ensure reward. :sob:
WYZZN becomes LGM in only 2 years and he only takes part in 12 contests
Was he a newbie. There are a lot of people in codeforces who participated in a lot of contests in other platforms before and then in Codeforces. You can clearly see in top 20's in div2 and div3 rounds, there are a lot of new coders. Clearly they are not newbie. They practiced in other platforms before.
most of them are accounts created by Experts,CM and Masters who want to know what will happen if they get first place in the first contest of an account
If you are a trusted participant in Div.3 and you want to get a higher rating, then do not try Div.2 or other rounds, until you get 1600 points or higher. Then you need to solve problems A to C in some past Div.2 rounds and check the editorial. If you’re sure you can solve at least 2 problems in Div.2 in 20 minutes and you can sometimes solve problem C, then try Div.2 rounds. If you haven’t had a point 1900 or higher in your rating and your rating is lower than 1600 again, then you should do Div.3 rounds. When your rating is 1900 or higher, then you should do the Div.2 rounds without a Div.1 round(because these rounds are rated for participants whose rating are lower than 2100) and educational rounds until your rating is 2100 or higher.
Remember, always do the easiest round you are allowed to do.
From my opinion,that is a bad idea especially that div 3 is not common and comes around every week only. A person should as much as they can to take part in all rated rounds. Not to mention the HUGE rating inflation in div 3 nowadays. You find yourself reached expert from div 3 and suddenly dropping in the upcoming div 2.
Yes, you're right, but my idea is only for people who just want to get 1600 points.
I think exploring editorial and alternate solutions are nice, plus checking shorter / simpler implementations of the same idea.
https://imgur.com/MviULla I tried to visualize the points made in this blog.
Wow! It looks fascinating! Can I add this in that blog?(I will write that you are the one who designed it(give credits to you)).
Ok, No problem.
How much time would you spend on a problem that wasn't easy for you when you were a newbie?
Maximum an hour. If I still didn't get the idea, then I would check the editorial.
I see. Thank you. Mind if I ask another question? How many hours did you train every day on average?
Well, I usually solve 2-4 problems a little bit above my level daily when there are no contests.
Sorry but u cannot go further! Your code is unreadable!
I am sorry if my code is unreadable. Speed-forces really messes my code up. But, in any team competition, I usually write better codes.
How many problems did you solve? If possible give a rough estimate per problem level. E.g Div2A — ?? B-??
His current solve count by problem difficulty (which I think is a better measure than Div2A / Div2B etc.):
His solve count when first became expert:
For more such statistics, you can use TLE bot
Hi, it's very impressive to become CM in only 1 year. Is there some new teqniques you can share to reach the goal even faster? I would be thankful
the most thing that helped me in as follows:
1)Try as much as possible to enter contests online.
2)Practice problems higher than your range by 100 to 300 points.
3)For problems close to your level, read its editorial if you couldn't get the answer correct.
4)Read about new data structures/algorithms if you encountered a problem about it close to your rating level.
Ok, I'll try, thank you
ana masri zik w 3iz 23rf enta 3mlt kda 2zi kont bt7l ms2l 2zi y3ni lw fi forsa nklm 2b2a 2li
Okay, sure! You can DM me on CF or Facebook if you want.
which sites did u use apart from codeforces to train ?
Mostly, CF. Sometimes OI style contests just to get used to it and sometimes atcoder(but rarely).
But how to stay motivated when you are dumbfuck like me :3
Put a good target for urself. My target is to reach IOI. That is how I am motivated.
could you suggest some target for 28 years old like me also which style u prefer VC or targeted practice and how many hours / day did u practice
Around 3 to 5 hours per day. I guess you should target for example an internship in a big company or a job in a big company or maybe getting a high rank in Facebook Hackercup or Google codejam.
thanks man, ur reply was a great help
I have been trying to practice the exact same way and here I am struggling to be stable pupil.I never learnt any new algorithm just for sake of learning, I only learnt when I came across a question which uses the concept, either through upsolving or random practicing. It is hard to stay motivated when this happens:(
Its okay. Usually, the start is the hardest part for many people but it was not to be honest for me. But, everyone have different rates at different parts. For example, it took me a while from Expert to CM more than I expected!(around 7 or 8 months!). But it took me only from specialist to expert 2 months which shows that everyone has different rates at different times. Maybe it will take me a year to reach master or a month. But, I am patient and if I kept practicing, I will reach master one day.
Thanks for sharing your thoughts.I am gonna keep practicing because I got nothing to lose anyway.Best of luck to both of us:)
You're welcome! Good luck to you too!
Are you used mostafa saad sheet in your training !!
Nope, I didn't use it. But I think it is useful for beginners.
I think I can reach CM in 6 months
I am trying so much for being expert. I have solved so many problems as well. But the fact is my performance is not average. It means in some contest I do good get good amount of plus but when I do bad at that contest I do really bad. My rating decreases so much.
What can be the solution? And sometimes I cannot solve easy problem. It decreases my inspiration.
your issues happen to everyone (or at least me). The only thing we can do is keep believing
Probably you check if there is a pattern in those "easy" problems. Something like if they were constructive problems, for example, then you may start solving constructive problems for a while, to gain both the confidence and tricks to solve them. The same goes for any other topic. I hope this helps you and good luck :D
Can anyone guide me how to start CP ..which type of questions to be solved and which contest to be participated ? how much time should be given for CP ? How to balance job as well as CP ?
You should try some High School Math before learning CP, and I mean Hard Math,search for IMOs and National Olympiads that Kind of Math I Mean
Can you share some resources?