Sometimes we have a good contest while in others we don't perform well. Just to lift your mood can you people share some funny incidents that happened with you during your competitive programming journey
# | User | Rating |
---|---|---|
1 | tourist | 4009 |
2 | jiangly | 3823 |
3 | Benq | 3738 |
4 | Radewoosh | 3633 |
5 | jqdai0815 | 3620 |
6 | orzdevinwang | 3529 |
7 | ecnerwala | 3446 |
8 | Um_nik | 3396 |
9 | ksun48 | 3390 |
10 | gamegame | 3386 |
# | User | Contrib. |
---|---|---|
1 | cry | 167 |
2 | Um_nik | 163 |
3 | maomao90 | 162 |
3 | atcoder_official | 162 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 157 |
8 | TheScrasse | 154 |
9 | Dominater069 | 153 |
9 | nor | 153 |
Sometimes we have a good contest while in others we don't perform well. Just to lift your mood can you people share some funny incidents that happened with you during your competitive programming journey
Name |
---|
Codeforces Round 694 (Div. 1)
I submitted B at 00:25 (103410744), pretests passed, 1998/2000 ms.
At 00:30, I decided to replace all
long long
withint
and I resubmitted, TLE on pretest 3.I moved to C, I got pretests passed at 01:33.
I checked the standings. It turned out that D was much easier than C, and it was worth 500 more points. I was unable to solve it in the remaining time.
I failed system tests on B (TLE on test 7).
After system tests, I resubmitted B with
int
, still TLE on test 3.A moment later, I realized that there's $$$w \leq 10^{18}$$$ in the input ($$$w$$$ was quite a useless variable, since every query with $$$w \geq 1$$$ had the same answer regardless of the value of $$$w$$$).
You should learn about the linear prime sieve
For some reason, I thought that the bottleneck in my code was the map of vectors, not the factorization.
In the same contest, when I solved problem B I saw that most people re solving C so I started solving it. When I finished, I saw D was solved twice as C so I said That I could've gotten much more points solving D and I was sad. An hour later, C failed system testing. Thank god there's no "Deactivate Codeforces account" button.
I got a wrong answer in contest only because i forgot to remove
cout << "hi"
99846875Is there a reason people don't use cerr, I don't see it a lot in people's code
You mean for debugging?
Yeah
Yes. It is flushed whenever you use the
<<
operator, asunitbuf
is set. This is basically likeendl
whenever you do cerr. That's why its sometimes not good for runtime to use cerr.Yes, it's not good to use
cerr
in runtime, but that's not the only usecase. Usually I usecerr
for debugging and comment it just before submitting the solution. But if I accidentally forget to do that, there's high chance the submission passes TL and doesn't yield WA.I once spent an hour figuring out what was giving me WA. Turns out I had written
a-=min(a,b); b-=min(a,b)
ignoring that value ofa
was getting changed in my code. Lesson learnt!! :weep:OMG! I literally did the same mistake once (82163671) and it took me a lot of time to realise how stupid I was.
yeah you are
Nobody asked.
umm just got -21 for replying to my friend
I'm sorry for my above comment then. Without context, it looked like you were rude and toxic :/
yeah my friend also said that
haha
You should learn about tie()
Once I wrote
#pragma GCC optimize("Ofast,untroll-loops")
.The trolls are definitely gone.
In codeforces round #698 I submitted 5 wrong answers for B. My first submission was at 00:31 and my Accepted solution at 1:14(with a minus of 250 points for Wrong Answers). The example test case had the value of d(which was the input) as 7. So while writing my code instead of using d I used 7 everywhere instead. All my example testcases passed because of this but got WA at testcase 2. It took my half an hour to realize that I needed to replace 7 with d. Here is my incorrect solution — 105742575
#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
In a contest i wrote
IOS
aftercin>>t
. My code was working fine locally but was giving wrong answer on some pretest. I moved IOS beforecin>>t
and it worked . Does someone know why it was actually causing the error ?Lol,
cout.tie(NULL)
.Even i removed cout.tie(NULL) , I am still getting wrong answer if i use IOS after cin>>t , submission
Why Lol ?
Also people who downvoted the comment above , may i know the reason ? If you provide feedback then i will ask my doubts next time with more care .
Reference
Thanks a lot . Also i am happy that unlike above person you didn't trolled and helped me instead . Thanks :)
cout.tie(NULL)
does literally nothing becausecout
is already tied toNULL
.In general I think people should read the documentation for such things instead of just pasting them "because it makes input faster". This would also have prevented your confusion here because the documentation tells you that the effect of calling that after reading input is implementation-defined.
I think you got downvoted because this was supposed to be a thread for sharing funny stories. Your story wasn't very funny, it was more like "asking a queston".
I remember it was at 0 votes before you replied.
My question wasn't on asking advice like what i should do before making a template .
I already knew that cout.tie(NULL) doesn't helps in making things fast (I read that in a blog on codeforces) . I made the template long back and didn't had any reason to change it . So why Lol in it ? I can tell few red coders still using cout.tie(NULL) . It's on me to change something or not .
I thought my mistake was funny and i asked people how it was wrong at the same time .
Did you really Laughed Out Loud after reading my comment ?
You have contributed to community a lot (through some interesting blogs) . Thanks for that . But i want to tell that i have seen you quite often making lol and similar comments on peoples silly mistake (usually low rated). I find it very bad thing tbh .
Also as EnterYourName said, i also saw that i had zero votes till you didn't replied . I don't know if you downvoted (since high rated users have more voting power) or lot of people downvoted but it was mostly due to your LOL comment .
Thanks anyway to both you and EnterYourName for Discussion . I agree with your point that one should read documentations and should not make off topic comments but that could have been told in first comment itself .
Why do you even care about upvotes/downvotes?
Yeah you are right . Contribution on codeforces doesn't actually represent how much person is really contributing .
My both comments aren't that bad to get that much downvote .
lol
Say lol from these accounts ks3rr_CheaterLeader Let_it_GO__90 too.
Dhruv aggarwal
I'm sick of this scammer(sells solution for money), who created multiple blogs about exposing cheaters. Yet he makes multiple fake accounts and spamming everyone.
lol
Comment #1 Comment #2
Yeah. Why should someone even care about upvotes/downvotes? They could either play it off by saying "Oh I'mma get downvoted".
It seems that apparently I was correct.
Yeah. You're the guy that says "I'm not a racist" and then make some racist joke.
So many people cheating from a particular country in almost every contest,so who was to blame then? Don't give me that shit:"Most Indians are not not cheaters bla bla bla...". Even many Indians themselves accepted that it was the problem of their country.
I don't wanna beat around the bush.
Everyone does care when they're downvoted.
This should have been your reply in the first place.
That's true . And i actually didn't asked about what he answered . Instead this reply was on-topic with my comment. But instead he has got higher votes than that person.
Thing is i didn't got down-voted by lot of users , but by few high rated users (High rated users votes have more absolute value).
Despite being its helpful, It somehow got downvoted than earlier lol.
I'm sick of these irrational guys but gotta take it for granted.
100954176 I put a break before reading the entire input in a multitest problem. It took me half an hour after the contest to realize the mistake.
In round 689, I got WA on a problem because of forgetting to print a newline in one of answers of the edge cases. 100942496
This happens quite often with me. I solve a question with answer as "YES" or "NO". It works fine on my system, giving all the answers correctly. But when I upload it, I get wrong answer. I spend a lot of time figuring out what is wrong with my algorithm, change my code in varied ways, only to realize at the end that the problem was with the way I printed yes and no.
Seeing poor performance at my end, I left a contest midway to do otherwise unimportant work. When I resumed after returning, I failed to submit E due to the shortage of a few seconds. Sed Lyf
Thankfully this only happened during a virtual contest xP Lesson Learnt!
In Codeforces Round 594 (Div. 2), I forgot to use
long long
in both the div2A (62980149) and the div2B (62990647), went grey because of that D:Also my solution for Good Bye 2020 E passed in 1996ms for a 2000ms TL, the same code passed in 600ms using C++17 (64)
This is ignorance. There is nothing funny in this.
I think seeing saarang dropping to grey is quite funny actually.
surang orz
Umm... before educational round 103, I made some changes in my template or better say I changed
to
I ended up making 10 wrong submissions for problem B and realised the mistake after checking my template.
P.S. Don't code while you are drunk.
I solved only one Question in last educational round and that too someone hacked.
I submitted B in place of C and lost points... :P
When I was participating in the first contest of my life, I didn't know that the difficulties increase so much, so when I couldn't solve the easier problems, I opened F thinking that maybe it would be easier than the previous problems. But obviously, I didn't even understand the statement.
How many problems you solved before participating in your first cf round?
CF+hackerrank combined, around 200
How so Orz. You solved 3 problems in your 1st contest, and I can't solve 3 problems in any contest even after 1 year of giving almost 100 contests.
I deduce your handle is lying...
why is this funny ? This sounds more like a flex tbh,
No flex . He is really good . He achieved red in 2 years which most people achieve in 4-6 years . Don't be jealous of him . Most of the comments in this blog aren't funny tbh and this blog title and description don't align .
Yes
yeah? but can he do a backflip though?
He did a backflip, snapped the bad guy's neck, and saved the day.
this was fuuny actually that a person can't solve d but was trying E and F
Yeah that was the joke. It sounded like a flex because I mentioned "first contest", but anybody would do such a mistake in first few contests only.
I did something similar in the last one. Couldn't crack E, tussled with F despite seeing 0 accepted submissions on it (too naive in hindsight). Didn't fathom it'd be rated 3000 even after being thrashed in the face by vain attempts, LOL.
so you are saying that even after solving 200 questions and possibly knowing from your peers / seniors that difficulty increases in cf contest, you thought that E and F were easier.... thats hilarious!!
The funniest part in this thread is your username.
I only solved easy problems from a2oj ladders, I didn't know anything about levels, divisions or ratings.
You can actually check my earliest submissions, at least 150 of them are only from a2oj ladders.
okk I can see your jealousy to him,Its common bro that a guy cant know about difficulty,200 qsn didn't justify that he should know about codeforces....
Why judging him so much ,,Oh! cause u havn't guts to reach the level at which healthyUG is...
I am not disrespecting anyone, i have seen his videos and he is doing a great job, and i would try to reach his level even if i cant , i was just curious about how he practiced before CF which he clearly stated in the comments
demoralizer massive respect man !!
Coincidently we are from the same city !!
mile kabhi VT pe :-p
if(a>b)?cout<<"Yes":cout<<"No";
int i,j,n,m; for(i=0;i<n;i++) { for(j=0;j<n;j++) { } for(i=0;i<m;i++} { } }
Figuring out why program is running for so long time(infinite).Replacing endl with "\n" got me from TLE to AC.
I once wrote
for (int i = 1 ; i <= n ; n++)
and it took me 30 minutes to debugI once wrote
#define ing long long
in my school's contest and spent 30 minutes trying to figure out why I got Wrong answer on test 3.During a contest, I attempted at solving problem E because it felt easier than a usual E. I didn't realize that I was trying E and submitting on D :( I didn't realize it even after the contest ended and was trying really hard to debug and find what's wrong.
1-gonMonogorz helped me find the bug :clownglasses: :ghosthug:Now, this is really stupid.
WAIT! YOUR ALIVE! DUDE, I THOUGHT YOU WERE GONE OR SMTH.
I got a tle in one solution because I was using long long int instead of int
Rookie here. In my first div 3 contest, I happily solved problems A and B and submitted the code at around 00:15 but got CE. Spent 40 mins trying to find the bug but still failed. Turns out that I selected the wrong language. Dang.
I once implemented two segment trees to find minimum and maximum element in the range related problem of the array. It was a sorted array (-_-)
1) Once, I had pretests fail just because I forgot to print "new line" on a corner case.
2) Once, I had pretests fail on a 1900 level problem (hardest in-contest problem) just becuase I forgot the case of 1.
3) Once, I had system-tests fail because I forgot to return m on a corner case.
4) Once, I had system-tests fail because of long long issues.
5) In the most recent contest, I spent 3 minutes of A, 30 minutes (ish) trying to solve B, then looked at C & solved it. After solving C, I finally figured out how to solve B, but I ran out of time. It turns out my A solution was hacked because of some dumb errors, so in teh most recent contest, I only solved question C.
6) Once, I accidently submitted problem D to the problem C slot, hence making me lose 50 more delta than before.
all these pre-tests and post-tests makes u wonder where's the in-test at
By post-tests, I meant system tests.
My solution got hacked because I used ceil(). Though, I learnt a lesson that I won't do this mistake in future.
Once I was returning the answer even before taking the whole input....RIP
In vector I made assigned values like v[i] = a, instead of v.push_back(a) in D problem. This was the only mistake in my solution during contest.
found this once
Once I got wrong answer on test case 149.I thought that I may be missing some edge case. But eventually it turned out that my whole logic was wrong but still it was able to pass 148 test cases.
Once i got wrong answer just because i have printed "N0" instead of "NO" . https://codeforces.net/contest/1388/submission/88469165
Once i tried to solve the very first question on the constraints given on an example .
In a contest, I failed a system test just because my code was printing 1e12 instead of 1000000000000 :\ sed lyf...
Codeforces Round #470. It's my first contest, I'm getting ready, I've been solving problems for a year now and I'm ready to get these problems solved. The contest started and I have no clue why the problems are that hard. I've read A, B and C and didn't have any idea so I moved to problem D and I thought I can solve this one.
One and half and hour has passed and I finished the code but I couldn't submit because I didn't register to the contest. Oh god, I'm in Div.1! I moved to Div.2 so quickly and solved problem A and started finding problem D in the Div.1, which was problem E in the Div.2, I got a wrong answer (obviously) and A didn't passed system testing. My university's coaches laugh at me until now, although my code had a bug and I solved it after the contest.
Don't code problem D Div.1 when you can't solve A Div.2.
In 2018, during the last phase of the Brazilian OI, I forgot to put the '\n' in one of my printfs in a segment tree problem, I tested the cases and everything seemed fine, because it hadn't reach the if that contained the bad printf. The contest was blind, so I ended with 0 points on that problem, thus not reaching the Team Selection Phase for IOI.
This took my whole morning : D
In the cf edu round 103 for problem B i wrote a correct code within 15 mins but I overwrote it on solution of A and wasted like more than 25 mins to find the bug. I had written the code for A in test_case() function but for B i wrote in precompute() function without erasing solution of A. Lol.
Just a tip if you (or someone else) uses vim, you can use
:u0
to restore the file to it's initial state at the time of opening. You can do that and start doing the next problem with a clean slate.once I used the same iterator variable inside a nested nogic, almost went mad debugging!
I secured 179 rank in CF round #692. Particularly because I did B problem very quickly. But when my friend asked me about the reason I used brute force to solve it, I was dumb and just said strong intuition made me write a brute force.
A few contests later, I secure 6086 rank in CF round #698, where I couldn't solve the B problem. But ironically, the way my friend solved the same problem was strong intuition and brute force only and he was unable to state a proof to it xD. The same condition like a recent problem but roles switched!
Submitted in the wrong problem and got "Wrong Answer on Pretest 2".
Well this happened to me in some atcoder ABC a while back...I had to print Takahashi in some problem as answer but I was printing Takashi. Costed me some reasonable amount of time :(
Once I've wrote two different ok solutions for this 987E - Petr and Permutations problem only to realize I was misspelling
Um_nik
withUm_Nik
. Always read the statements!I did an oopsie in Codeforces round #700 div2/B. Instead of "<=" I used "<" and pretests were passed during the live contest but gave WA after system testing. Sed lyf I guess :(
I started Quora Programming Contest Div 2 (actually it is just round 2) late by 50 minutes. I thought it started at 10 am local time when it is actually 9 am.
In the last few minutes I was fine-tuning some weights for an ML task and luckily got into top 50 for the shirt.
I learnt to never give up :P