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!
Well, that's stupid, of course, but doesn't hurt as much as using
unordered_set
instead of justset
(when time complexity allows it, of course).So imagine you realise that you only need
O(1)
access, you decide to useunordered_set
, and you get hacked by this stupid shit: https://codeforces.net/blog/entry/62393Although,
O(log(n))
would also be allowed, and you could've used a standardset
. Because of this crap in the blog post above, I'm now scared to useunordered_set
.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.
Java users when they try to sort arrays using Arrays.sort (it uses quick sort)
This is exactly the reason why I have a copy-paste hash function that I always use with
unordered_map
andunordered_set
.If you read the blog, it tells you what to do in order to not get hacked. So why are you scared?
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
withoutios_base::sync_with_stdio(false)
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...
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.
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.
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!
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.
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.
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.
lol. Im confused what are you even trying to write in the max function?
Anyways, we can both agree that debugging is important :P
I think I meant to put something like
max(n,k)
in there which would've made more sense. I meant to copy the code from here (https://github.com/alxwen711/pythonCompetitiveLibrary/blob/main/algorithms/math/combinatorics/fermatCombinatorics.py) which I created a few months prior to this.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.
yea that's painful. 8 submissions costs around 400 points doesn't it?
Yes exactly and I could gain around 15 rating if there isn't that.
Needing to write brute force program to find out that my answer is wrong for "LLLRRR" (0 instead of 2). How stupid am I!
Auto comment: topic has been updated by TheOpChicken123 (previous revision, new revision, compare).
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:
oh gosh i had the same problem. Thank god I was able to figure it out in time tho :))
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!
You arent the only one. LGMs like jiangly also made this mistake
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 :))
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.
You should give up.