TomDev's blog

By TomDev, history, 5 months ago, In English

Problem

I'm a beginner and I have just approached Codeforces. I didn't know anything about DSA, Competitive Programming, etc... I want you to help me by giving some tips for solving Codeforces problems and competitive programming problems, with a question: should I look up editorial when I am stuck on a problem while practicing, or keep trying to solve them?

I appreciate anyone who gives me the answer because I've looked up on the internet and their answers are mostly too general, so I need help from guys.

Please help me answer these 2 main questions:

  1. Tips for problem-solving (competitive programming)

  2. Should I look up on editorial each time I get stuck?

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

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

don't look the tutorials.

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

    why?

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

      because you'll never get pass master if you look at tutorials(I think). You see? I don't use tutorials at all.

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

        yupp 100000%, your profile is proof u don't watch tutorials

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

        bro is a fucking monster? 1600 problems and still not pupil. what's up, bro?

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

          You, can have a look at my profile too.

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

            i think the reason you are not improving is that you solve a lot of 900-1200. thats already your rating and you barely even challenge yourself to hard problems(like +200 to your max rating, 1400-1600 rated ones. try it out and see your improvment

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

        alr, thanks!

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

        I think it is normal to look for edutorials. Just don't look at them right after you finish reading the statement.

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

          not in my option

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

            I think you meant "not in my case" or "not in my opinion". Confusing.

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

              no, I just think it's bad. It's not just in my case, I really think it's bad, that's why I wrote "option" instead of "case"

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

        bro at a certain point i feel like you should know every low rank idea by heart like wtf

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

          it's funny how you reply dumb comment to a comment written 2 months ago.

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

    why ? its ok to look the tutorial if you are stuck for a while

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

      a while is how much? I have once try a problem and solved it after a year or 2.

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

        If after 10-20 min of thinking you cant solve it, that means you don't know algorithm or don't know trick, then look at editorial. And after this you should do it by yourself not even looking to the editorial, mark problem if it was new or was unusual to you. Then after some time try to solve it again, codeforces has "Favourites" feature so it won't be a problem.

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

          I don't think I ever solved a hard problem thinking <20 minutes on it.

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

            Then you need to grasp a lot from good programmers such as Shayan, Errichto, Colin Galen, William Fiset, Abdul Bari(all their youtube videos and broadcasts are good).

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

          How to see my favorited problem?

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

            click the star beside the submit in problemset and then go to your profile and there you can find a tab "favorites" and you can see what you marked.

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

        solving a problem after a year or 2 is wasting for your time cuz there are alot of similar problems to any problem an its ok to look the tutorial of one of them

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

          so very not true, learning a new idea from nowhere != learning by trying and thinking.

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

First of all try solving problems of maths, greedy, constructive algo, number theory it will help you to solve div 2 'a' problems and sometimes 'b' too>>

As you said you just started codeforces so i will suggest you to look for the editorial after some time because at this phase in most of the questions you will not be able to approach the question

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

Q1: Enjoy the problems and don’t force yourself to solve’em … you’ll be more effective when you are in the mood.

Q2: I highly encourage you to consider approaching the problem many times even if you are stuck and put it in your unsolved problems list and try it again later. This really gives you confidence and improves you a lot.

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

1.Practice EDU rounds and Atcoder Beginner Contest because there are lots of classical problems here and many problems evolved from a classic problems.

2.Correct your wrong answers after every contest you've paticipated.This is a process of finding and filling gaps.

3.Proficiency in common algorithms and tricks.Try to use template and understand the theory of them.By using template proficiently,your efficiency on coding will imporve.

4.Use this handbook to learn new topics (https://cses.fi/book/book.pdf)

5.You can refer to the editorial of the problem whenever you will that now you can not solve that problem. I recommand you to refer the code of tourist if you are a c++ programmer as his code is more easier to understand

»
5 months ago, # |
Rev. 9   Vote: I like it 0 Vote: I do not like it

Im new to DSA aswell, so take this advice from a noob's perspective. Things i did were, in order:

  1. Learn C++, idk why but i dont regret that. I came from Python.

  2. Solving lots of string, array, loops problems on leetcode. Look up editorials if i couldnt after a while to build mind-maps of solution patterns.

  3. Participate in cf contests(exposes you with test/edge cases) with the sole aim of solving the first and only the first question with all i've got.(5-6 contests, 5-6 problems solved)

  4. Finding this awesome resource where my time is currently spent, solving problems in there without looking at solutions.

I wanted to learn DSA to get ratings initially, but i happened to just love solving problems and seeing it get accepted gives me more joy and confidence, rating just seems secondary to me now. My advice would be to practice daily, breaks create a dent in your DSA skills, speaking from experience. GudLuck!.

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

    Thanks, bro, that's excellent advice. But I think my problem is that I do not truly love the problem. For example, when I see a hard problem, I feel a bit nervous, and I don't know how to cure it.

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

      so don't go for hard problems.You can follow this cp sheet.Practice problems of rating 800 , 900, 1000 only.

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

        But the problem that is I'm nervous when seeing a hard problem, that makes me can't grow.

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

      What I meant is, you don't need to love the problem but crave the mental effort that the problem brings with it.

      Trust me, editorials will only get you so far, but when you sit at a problem for hours on end you will arrive at concepts that can be used from your past problem solutions, it's totally okay to not arrive at the solution, but the effort you put your mind through is never wasted and it's like a bank of knowledge. That how I'm developing myself and I'm sure it will work for others too.

      It happens like this. "Damn, I can't solve this..." moves over to the next problem "wait I can solve this using the ideas I came up during the last problem!!".. but how do you get those ideas when we depend on editorials?. That's what seems to make me better day by day, building that bank of ideas.

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

My experience: During Pinely round 4 (Div 1 + Div 2), I was only able to solve problem A, and only really understood how to solved B,C, and D after I looked at the editorial. In my next contest, Educational codeforces round 168, I got ABC correct, and got stuck at D, and I also referenced the editorial there after the contest. Therfore, in general, I would recommend looking at an editorial if you are ever really stuck on a problem.

What I recommend for you (specifically): Looking at your contest history, I would recommend to practice old Div.2 contests, and really try to solve A, B, and maybe C. For whatever problems you can't solve, I would recommend looking at an editorial.

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

Well i would say that look at some of standard algos and logic from standard leetcode problems, like sliding window problems, two pointer problems, math, these are more than enough to reach pupil, you dont need dp, graph, tree for pupil, however beyond that it is necessary. Solve problems rating wise, like first do 1000s, then 1100, then 1200s, and so on. if you are not able to solve a problem don't look at editorial. just switch the problem to some other problem of same rating, and again come back to that problem next day. there is high change your brain must have thought some approaches to solve that problem, if not than look at the editorial.