Xbalanque's blog

By Xbalanque, history, 12 hours ago, In English

Today's contest i gave, I got WA on every question, in last after 2 hours of trying hard i got problem A solved.

I will still lose rating points.

Why is it like this ? MY leetcode rating is 1400 but codeforces is not even 1000.

How should i practice and how do i get better and whats wrong with me ?

today's contest was too hard ?

Thanks!

  • Vote: I like it
  • -6
  • Vote: I do not like it

»
12 hours ago, # |
  Vote: I like it +2 Vote: I do not like it

In 297333141 int duplicate_input_for_safety = current_input_value_for_the_lock;

why do you need duplicate input for safety lol

  • »
    »
    12 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    as i said its for safety purposes only, i was scared it could get lost somwhere in calculations and i might regret it later. so i made another varibale to store i.

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

    never saw anyone using that long variable name XD

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

The contest was rated for every division, so it is supposed to be hard for newbies to attend and solve more than one or two questions. I am just a specialist, so I can relate more to what you are feeling now.

It is common to feel like your solution is right but somehow fails on hidden test cases and gets irritated. It especially happens a lot when you start on competitive programming. It is common. How you should combat it? This is my debugging train of thoughts:

  1. Loss of generality: Do you have a general non-specific proof that your answer is valid? Or intuitive proof at least? If not, your approach is wrong, and you should think of a new approach. A big and stupid mistake I made when I started was making it pass sample test cases, then thinking of cases where my code didn't work and adding them one by one.

  2. You have intuitive proof that your approach works; "I don't know if this is the correct answer, but what I am doing feels like the right thing to do because of a reason ". The key difference between 1 & 2 is that you have a gut feeling or instinct that this is the solution. Generally, the gut instinct becomes more true the more you solve problems. So unless you are 100% sure, form a proof and try to give counterarguments against your gut instinct. This often leads to Identifying edge cases or better approach.

  3. You have solid proof that your approach works; Find implementation faults. can be an int instead of long long, might be garbage values or some very weird edge case.

  • »
    »
    12 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    stop using chat gpt

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

      Used grammarly since my english writing skills suck, the rephrase option might have made the comment sound more AI generated

      Quillbot says 0% Ai generated so maybe before bashing others, have a second read?

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

Leetcode!=competitive programming

»
12 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

I know this advice is overused but it is true nevertheless. I used to get irritated on not being able to solve problems too and used to think that I could not solve a problem simply because I didn't know enough DSA and stuff. But the simple truth is that these problems which you are getting stuck in require practice to crack. I took too long to solve A and B today, and the reason why is I had not solved enough problems of that rating range in a week or so. Your profile shows you have solved 17 problems till now. If you genuinely want to improve and are not here just for an ego boost or something, go to the problemset page, choose problems of around your rating range, and keep solving. Eventually, you will build pattern recognition and problem solving skills automatically.