Wednesday, April 16, 2008

An anecdote of mistakes

I am participating in TopCoder Competitions for a while and this was my 12th match.
Those who don't know what TopCoder is, follow the link:
http://www.topcoder.com/tc

It was started a bit slow for me because i stuck in 250 as i forgotten the sort function. but after i saw the 500 my happiness can be seen in my eyes....what an easy prob!!!
To learn from this problem is look for all the STL carefully and thoroughlly...
Now the 500 which made my face glowing was not that easy because i understood it wrongly in hurry and excitement...so made a wrong solution and after wasting so much time on it didn't submit it...my bad!!
The 900 was equally easy and i put my whole effort into it...but after debugging for few minutes i finally passed all the examples so submitted it...here comes the moment of my life...I submitted a 900 during a SRM round...WOW!!!
My joy thrashes in just 15 minutes....my 900 didn't passes the systests...Oh GOD!! Jhandu was continuously teasing me for this....i didn't knew what could be the mistake and i finally after the hangover in next morning caught the mistake (YEAH!! I had a drink last night..why not?? my first 900 was failed)....it was a string overflow....i moved the string even after its length...it was really a horrible mistake.....
To learn--
1) Read a good book for STL.(reason for slow 250)
2) Always read the problem carefully and see the examples carefully to understand even if it's clear from the problem.(a mistake in 500)
3) Check for all the conditions in loops and ifs.(esp. for string overflow :( ...never gonna forget this one.

So a lotta learn from this SRM 398.