Блог пользователя TomDev

Автор TomDev, история, 3 месяца назад, По-английски

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?

  • Проголосовать: нравится
  • +8
  • Проголосовать: не нравится

»
3 месяца назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится
»
3 месяца назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

don't look the tutorials.

  • »
    »
    3 месяца назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    why?

    • »
      »
      »
      3 месяца назад, # ^ |
        Проголосовать: нравится 0 Проголосовать: не нравится

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

      • »
        »
        »
        »
        3 месяца назад, # ^ |
          Проголосовать: нравится 0 Проголосовать: не нравится

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

      • »
        »
        »
        »
        3 месяца назад, # ^ |
        Rev. 2   Проголосовать: нравится +9 Проголосовать: не нравится

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

        • »
          »
          »
          »
          »
          3 месяца назад, # ^ |
            Проголосовать: нравится 0 Проголосовать: не нравится

          You, can have a look at my profile too.

          • »
            »
            »
            »
            »
            »
            3 месяца назад, # ^ |
              Проголосовать: нравится 0 Проголосовать: не нравится

            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

      • »
        »
        »
        »
        3 месяца назад, # ^ |
          Проголосовать: нравится 0 Проголосовать: не нравится

        alr, thanks!

      • »
        »
        »
        »
        3 месяца назад, # ^ |
        Rev. 3   Проголосовать: нравится +3 Проголосовать: не нравится

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

        • »
          »
          »
          »
          »
          3 месяца назад, # ^ |
            Проголосовать: нравится 0 Проголосовать: не нравится

          not in my option

          • »
            »
            »
            »
            »
            »
            3 месяца назад, # ^ |
              Проголосовать: нравится +3 Проголосовать: не нравится

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

            • »
              »
              »
              »
              »
              »
              »
              3 месяца назад, # ^ |
                Проголосовать: нравится 0 Проголосовать: не нравится

              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"

      • »
        »
        »
        »
        3 недели назад, # ^ |
          Проголосовать: нравится 0 Проголосовать: не нравится

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

  • »
    »
    3 месяца назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

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

    • »
      »
      »
      3 месяца назад, # ^ |
        Проголосовать: нравится +3 Проголосовать: не нравится

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

      • »
        »
        »
        »
        3 месяца назад, # ^ |
          Проголосовать: нравится 0 Проголосовать: не нравится

        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.

        • »
          »
          »
          »
          »
          3 месяца назад, # ^ |
            Проголосовать: нравится 0 Проголосовать: не нравится

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

          • »
            »
            »
            »
            »
            »
            3 месяца назад, # ^ |
              Проголосовать: нравится 0 Проголосовать: не нравится

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

        • »
          »
          »
          »
          »
          3 месяца назад, # ^ |
            Проголосовать: нравится 0 Проголосовать: не нравится

          How to see my favorited problem?

          • »
            »
            »
            »
            »
            »
            3 месяца назад, # ^ |
              Проголосовать: нравится 0 Проголосовать: не нравится

            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.

      • »
        »
        »
        »
        3 месяца назад, # ^ |
          Проголосовать: нравится 0 Проголосовать: не нравится

        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

        • »
          »
          »
          »
          »
          3 месяца назад, # ^ |
            Проголосовать: нравится 0 Проголосовать: не нравится

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

»
3 месяца назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

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

»
3 месяца назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

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.

»
3 месяца назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

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

»
3 месяца назад, # |
Rev. 9   Проголосовать: нравится 0 Проголосовать: не нравится

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

  • »
    »
    3 месяца назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    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.

    • »
      »
      »
      3 месяца назад, # ^ |
        Проголосовать: нравится 0 Проголосовать: не нравится

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

      • »
        »
        »
        »
        3 месяца назад, # ^ |
          Проголосовать: нравится 0 Проголосовать: не нравится

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

    • »
      »
      »
      3 месяца назад, # ^ |
      Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

      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.

»
3 месяца назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

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.

»
3 месяца назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

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.