Ahmadsm2005's blog

By Ahmadsm2005, 2 months ago, In English,

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 emma)

  • You should like competitive programming. Most of the time if you like a subject, you would be good at it!(Suggested by emma)

  • 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 mahfuzz (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!

 
 
 
 
  • Vote: I like it
  • +111
  • Vote: I do not like it

»
2 months ago, # |
Rev. 2   Vote: I like it +48 Vote: I do not like it

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.

  • »
    »
    2 months ago, # ^ |
    Rev. 2   Vote: I like it +14 Vote: I do not like it

    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!

    • »
      »
      »
      2 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      There must not be a big gap between those or else, reaching the step after it(Candidate master) might be really hard!

      1. Reach expert level in 6 months (and think about Candidate Master later).
      2. Remain newbie and become expert only after 6 years (because you were learning candidate master stuff which doesn't help you at this point).

      Pick one of the above.

      • »
        »
        »
        »
        2 months ago, # ^ |
        Rev. 2   Vote: I like it +12 Vote: I do not like it

        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!

        • »
          »
          »
          »
          »
          2 months ago, # ^ |
          Rev. 2   Vote: I like it +8 Vote: I do not like it

          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.

          • »
            »
            »
            »
            »
            »
            2 months ago, # ^ |
              Vote: I like it +12 Vote: I do not like it

            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!

            • »
              »
              »
              »
              »
              »
              »
              2 months ago, # ^ |
              Rev. 3   Vote: I like it +12 Vote: I do not like it

              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).

            • »
              »
              »
              »
              »
              »
              »
              2 months ago, # ^ |
                Vote: I like it +5 Vote: I do not like it

              hes rigth learning some algorithms like data structures will bann your mind and you cant solve them with easy solutions like stack trick

        • »
          »
          »
          »
          »
          2 months ago, # ^ |
            Vote: I like it +9 Vote: I do not like it

          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.

      • »
        »
        »
        »
        2 months ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        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.

        • »
          »
          »
          »
          »
          2 months ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          There isn't a magic list of DS/algo that will get you to a certain rank to be honest ... There is a reason why wannabe competitive programmers who learn such stuff extensively still fail to reach a high rating.

  • »
    »
    2 months ago, # ^ |
      Vote: I like it +15 Vote: I do not like it

    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.

»
2 months ago, # |
  Vote: I like it +16 Vote: I do not like it

Most of the tips given to beginners are same,I guess the only thing that really works is hard work and practice.

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

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.

  • »
    »
    2 months ago, # ^ |
      Vote: I like it +4 Vote: I do not like it

    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.

    • »
      »
      »
      2 months ago, # ^ |
        Vote: I like it +1 Vote: I do not like it

      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.

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

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!

  • »
    »
    2 months ago, # ^ |
      Vote: I like it +1 Vote: I do not like it

    Yeah the main idea is learning,but still rating/rewards give encouragement and motivates you to do better.

  • »
    »
    2 months ago, # ^ |
    Rev. 3   Vote: I like it +2 Vote: I do not like it

    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.

    • »
      »
      »
      2 months ago, # ^ |
        Vote: I like it +1 Vote: I do not like it

      In my experience the people who obsess over job interviews but have no passion are not the ones who achieve high rank.

      • »
        »
        »
        »
        2 months ago, # ^ |
          Vote: I like it +7 Vote: I do not like it

        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.

      • »
        »
        »
        »
        6 weeks ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        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.

  • »
    »
    6 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    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.

»
6 weeks ago, # |
  Vote: I like it -15 Vote: I do not like it

its really painful to code. just doing it for getting placements.

  • »
    »
    6 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    u are absolutely right it is a harsh truth.

»
6 weeks ago, # |
  Vote: I like it +12 Vote: I do not like it

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.

  • »
    »
    6 weeks ago, # ^ |
      Vote: I like it +2 Vote: I do not like it

    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.

    • »
      »
      »
      6 weeks ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      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.

    • »
      »
      »
      6 weeks ago, # ^ |
      Rev. 3   Vote: I like it 0 Vote: I do not like it

      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.

      • »
        »
        »
        »
        6 weeks ago, # ^ |
          Vote: I like it +4 Vote: I do not like it

        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).

»
6 weeks ago, # |
Rev. 2   Vote: I like it +6 Vote: I do not like it

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!

  • »
    »
    6 weeks ago, # ^ |
      Vote: I like it +12 Vote: I do not like it

    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.

»
6 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

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.

  • »
    »
    6 weeks ago, # ^ |
      Vote: I like it +1 Vote: I do not like it

    Wow awesome! You did a great job! Good luck in your next step!

    • »
      »
      »
      6 weeks ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      You have done quite a great job. A lot of submissions in just 6 months. You are surely going to be a CM quickly.

      • »
        »
        »
        »
        6 weeks ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        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?

        • »
          »
          »
          »
          »
          6 weeks ago, # ^ |
            Vote: I like it +7 Vote: I do not like it

          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.)

          • »
            »
            »
            »
            »
            »
            6 weeks ago, # ^ |
              Vote: I like it +3 Vote: I do not like it

            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.

          • »
            »
            »
            »
            »
            »
            6 weeks ago, # ^ |
              Vote: I like it 0 Vote: I do not like it

            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.

      • »
        »
        »
        »
        6 weeks ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Thank you! Good luck for you too!

»
6 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

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!

  • »
    »
    6 weeks ago, # ^ |
      Vote: I like it +3 Vote: I do not like it

    While it is good mindset to get better, sadly it doesn't ensure reward. :sob:

»
6 weeks ago, # |
  Vote: I like it +3 Vote: I do not like it

WYZZN becomes LGM in only 2 years and he only takes part in 12 contests

  • »
    »
    6 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    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.

    • »
      »
      »
      6 weeks ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      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

»
6 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

I agree.

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.

  • »
    »
    6 weeks ago, # ^ |
    Rev. 2   Vote: I like it +10 Vote: I do not like it

    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.

    • »
      »
      »
      6 weeks ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Yes, you're right, but my idea is only for people who just want to get 1600 points.

»
6 weeks ago, # |
  Vote: I like it +3 Vote: I do not like it

I think exploring editorial and alternate solutions are nice, plus checking shorter / simpler implementations of the same idea.

»
6 weeks ago, # |
  Vote: I like it +6 Vote: I do not like it

https://imgur.com/MviULla I tried to visualize the points made in this blog.

  • »
    »
    6 weeks ago, # ^ |
      Vote: I like it +1 Vote: I do not like it

    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)).

»
6 weeks ago, # |
  Vote: I like it +3 Vote: I do not like it

How much time would you spend on a problem that wasn't easy for you when you were a newbie?

  • »
    »
    6 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Maximum an hour. If I still didn't get the idea, then I would check the editorial.

    • »
      »
      »
      6 weeks ago, # ^ |
        Vote: I like it +3 Vote: I do not like it

      I see. Thank you. Mind if I ask another question? How many hours did you train every day on average?

      • »
        »
        »
        »
        6 weeks ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Well, I usually solve 2-4 problems a little bit above my level daily when there are no contests.

»
2 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Sorry but u cannot go further! Your code is unreadable!

  • »
    »
    2 weeks ago, # ^ |
      Vote: I like it +1 Vote: I do not like it

    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.