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

Автор TheOpChicken123, история, 2 года назад, По-английски

I have made the same mistake twice now...

Wondering what the mistake is? Well it is using a set instead of a multiset. I made this mistake in the last contest of 2022, which almost cost me the chance to become expert by the end of 2022. And now, i made it again in the first contest of 2023, and, will likely lose me expert status because of it.

I am kicking myself over this... Howwwwww,.. whyyyyyy....

Anyways, hopefully i will learn from this mistake and never make it again.

I also advise everyone reading this blog to always consider whether to use multiset or set as it can be the difference between AC, and WA. oftentimes, there is only one right answer.

Also, it is very important to not make a habit of using one over the other. This is the main reason i made both the mistake. I have never really needed to use multiset in my life. On the other hand, I use set quite frequently. This is why I had a habit of using set and not multiset and i didn't even think about it.

Hope everyone has great contests in 2023!

Actually no, please do shit so I can gain more rating points.

UPD: I only lost 4 rating points! I'm so glad that I didn't lose my expert status although I am very surprised that I only lost 4 points. I thought I would lose at least 30 or so rating points so I am very happy!

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

»
2 года назад, # |
  Проголосовать: нравится +7 Проголосовать: не нравится

Well, that's stupid, of course, but doesn't hurt as much as using unordered_set instead of just set (when time complexity allows it, of course).

So imagine you realise that you only need O(1) access, you decide to use unordered_set, and you get hacked by this stupid shit: https://codeforces.net/blog/entry/62393

Although, O(log(n)) would also be allowed, and you could've used a standard set. Because of this crap in the blog post above, I'm now scared to use unordered_set.

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

    well, i have actually been hacked for using unordered_map and unordered_set too many times, trust me. That's why I have never used unordered_set or unordered_map again in my life. Nowadays, my default is either to use map, or set, and if my solution is too slow, then I try changing it to unordered_set or unordered_map, mostly because Im so scared of getting hacked.

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

    This is exactly the reason why I have a copy-paste hash function that I always use with unordered_mapand unordered_set.

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

    If you read the blog, it tells you what to do in order to not get hacked. So why are you scared?

»
2 года назад, # |
  Проголосовать: нравится +49 Проголосовать: не нравится

I am doing competitive programming for almost 15 years. I still overflow ints occasionally. Also, at the end of November I caught several TLEs because I printed a couple of millions numbers using cout without ios_base::sync_with_stdio(false)

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

    Wow. Good to know that even the best make silly mistakes :)). But im salty because the last one you made was at the end of November...

»
2 года назад, # |
  Проголосовать: нравится +30 Проголосовать: не нравится

I lost F today because "herp derp if I minimize the answer then I don't have to think about anything" introduced a bug in my code.

I got 3-4 WAs in the contest before this one because I typed = instead of += when taking the sum of things in a subtree.

Shit happens. I'm a bit salty that literally the fucking last test got my solution in today's F. Don't get me wrong, good job by the testers/setters to make a test that catches such stupidity, but it being the literal fucking last test makes it hurt a bit more.

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

    Wow ur second problem has to hurt. I remember making a similar mistake a few times and its so annoying because its the tiniest mistake and therefore its so hard to spot.

    Unless you read every line and every character of your code its almost impossible to find the error.

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

My two worst mistakes:
- In this problem,I thought that the move is between two adjacent towers only!
- In today problem ,I thought that multiply an element by -1 at index<m which has prefix[index] <prefix[m] will increase this prefix only, how stupid I am!

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

    Oof. The worst types of mistakes (in terms of costly the mistake is) are mistakes in your understanding of the question or in your logic.

    In this contest itself I had misunderstood question B and i thought that the sum of any pair a[i] + a[j] = the sum of the whole array when it is actually just all adjacent pairs a[i] + a[i+1].

    Its so costly to make this mistake cos if you write the code to answer the question (or what you thought was the question) then you will waste both valuable time and many resubmissions not doing anything useful at all.

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

    The first mistake is funny, because the problem was supposed to be like that. BledDest initially wrote the problem with only adjacent moves allowed and told me to prepare it. I didn't notice the word "adjacent", still agreed with the difficulty and prepared it like you see it now.

    When we discovered the mistake (when BledDest looked into my solution, realized it doesn't make sense and read the statement), we just decided to keep it.

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

https://codeforces.net/contest/1717/submission/170634783

Specifically, this one Python line:

arLen = max(n+k)+3 #array length

For context, n and k were int values. Normally there would be something to learn from a mistake made in a contest, but I mean, how do I even explain messing up the syntax for max() in python.

There was also the "I can't count to five" incident I had earlier in 2022. Let's just say debugging is important in programming as a whole.

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

Well in yesterday's C I had a lot of stupid typing mistakes(such as '+=' to '+'), which cost me a whole 8 submissions and a lot of precious time.

»
2 года назад, # |
  Проголосовать: нравится +6 Проголосовать: не нравится

Needing to write brute force program to find out that my answer is wrong for "LLLRRR" (0 instead of 2). How stupid am I!

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

Auto comment: topic has been updated by TheOpChicken123 (previous revision, new revision, compare).

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

I lost D yesterday. Didn't consider the case that if Ai=Bi, we should ignore it. After system tests I submitted with one more If statement, and it ACed. :sad:

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

I made a silly mistake too in problem B, I forget to add cout<<"YES" in my code

because there were two cases for Yes in my code. and I found this mistake in the last minutes which led me to lose points and I couldn't become a "Pupil".

I know it's not a big deal for people who has a higher rate but for me it will be a big achievement as it will be my first step to achieve something after 2 Years of CP I hope this year I will achieve this!

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

    You arent the only one. LGMs like jiangly also made this mistake

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

    I actually made this mistake as well... I can't believe both of us as well as an LGM made the same mistake. It is kind of funny in my opinion :))

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

Once I have spent on a problem 120+ minutes. Not very surprising, but the thing is that I had solved this exact problem a year ago before that in 10~ minutes.

»
2 года назад, # |
  Проголосовать: нравится -18 Проголосовать: не нравится

You should give up.