Ask HN: How can someone solve a code jam competition problem in 1.4 minutes?
He / She did it in 1.4 minutes.
Just reading the description of the question, writing the code and compiling will take me more than that.
Is that person simply a genius? My ego is shattered beyond recognition. (Instead of being happy that I solved my first competition problem...)
p.s. the problems this year seem way harder than the qualification rounds samples they have there. I never felt more stupid in my life. I recommend anyone who has a steady programming job, to stay away from these competitions, even if you are considered the smartest coder at work. You will feel stupid and incompetent, (and humbled to the ground).
I wish I could see a video of one of them as they code.
Could it be that questions in competitions simply repeat themselves and they just pulled some similar code and just modified it?
what are the "secrets" of programming competitions? Is it like chess? if you practice enough past competitions you are pretty much ready to anything they'll throw at you?
Or are these people really, really smart? (Or I'm really really stupid? :))
Ego shattered to the floor, considering switching careers (and I'm considered a pretty good developer...)
Very humbling experience, perhaps too humbling.
11 comments
[ 1.6 ms ] story [ 37.5 ms ] thread* dynamic programming
* tries
* depth/breadth first traversal of a graph
* combinatorics
* graph colouring
* prime generation techniques
These topics are almost guaranteed to crop up every year, and the people who do well in these programming competitions learn all these techniques off by heart. They have their own library and macros which do all this stuff, and when they read the question they instantly see which technique they need to use and boom they're done. You have to remember that these people have been practising this stuff from a very early age, and that in many cases, spending hours and hours becoming good at this is their only way out of a crappy life (Eastern Europeans). However, being good at competitive programming has very little correlation with being a good software engineer (I think there is some analysis done by the likes of Google or Microsoft which proves this, I will try to find the link later).
http://code.google.com/codejam/contest/6224486/dashboard
I am pretty sure he skipped compiling! I am being serious here.
Honestly, I am not sure why you are surprised. Competitive programming is different from regular programming, and like every other field it require years of training and experience to become good.
After a while you just learn to recognize patterns and common topics.
I think your comparison to chess is a good one. Both chess and competitive programming require years of deliberate practice to become good.
Source: done both. Though I was only somewhat good at chess, I was fairly successful at programming contests a few years ago(not this guy's level good though).
> Is that person simply a genius? My ego is shattered beyond recognition. (Instead of being happy that I solved my first competition problem...)
Don't feel bad about yourself! Imagine a Java programmer writing their first haskell program and being surprised at how quickly haskell programmers are able to write code in haskell. That's how your post looks to me.
Btw, is it this competition? https://code.google.com/codejam
FYI, he gave a Quora answer about his view on Competitive Programming http://qr.ae/dx4m6
"Especially in the United States, there's little glory to be had in doing programming contests. I've invested thousands of hours into them, solving problem after problem, writing line of code after line of code, for what? My peers, meanwhile, are off doing amazing things: some are doing ground-breaking research with professors, others are finding new passions that they only could have discovered at Stanford... the list goes on. I'll be retiring from competitive programming after World Finals this year, in part because I want to live a more normal life."
That's in 2013, and he is still participating in this year's contest, so I guess he is still in love with it :p
Anyway, I did my first code jam last year and also got my ego shattered when looking at the scoreboard. I passed the online qualification round though, but decided to stop since I think it's nonsense trying to complete with thousands of competitive programmers to get to top 1000 when I never practiced as much as them. I used to be like them when I did math contests in high school, so I know what it feels. It's not about your IQ or anything like that, it's just about practice, practice, practice.
It's up to you to decide whether competitive programming is good for your career. For me I'm still doing it occasionally for fun (not really competitive since I just pick problems in areas that I find interesting and do it alone), but since I'm already spend 8 hours a day at work and have a bunch of unfinished side projects in hand and a long list of other things I want to learn, I don't think it's worth spending thousands hours of my time to compete in such contests.
You can also refer to this https://news.ycombinator.com/item?id=9337863 . I think the situation is similar, as doing competitive programming means putting yourself in relative comparison with others. It's just a double edged sword =)