On Saturday, April 18, 2015 at 4:20:55 PM UTC-4, Неугомонный wrote:
> Hi, this must've been already asked here but I couldn't find any links, 
> please refer to existing post if I'm repeating someone's question.
> 
> What is the best way to prepare for this challenge? Just your thoughts in few 
> words, I'm not asking for anything special.
> 
> This is the first time i participate in competition and I feel I have enough 
> brain power left to at least qualify for Round 2 but....
> 
> My today's epic failure to pass Round1 was a second alarm (first one was the 
> qualification round where I spent too much time solving the pancake task) 
> that I don't have sufficient experience in this kind of assignment. 
> 
> Today I had a solution for A within minutes but made a silly mistake and end 
> up spending lots of time debugging - I got it right eventually and I was 
> still within the 50 minute per task so not too bad.
> 
> Then I jumped to second task and panicking and ended implementing brute force 
> solution without seeing that N can be 10 to power of 9 - you can guess the 
> result...
> 
> I regrouped and somehow my brain suggested a solution which was correct but 
> yet again I made a mistake of ignoring the rounding and ended up debugging, 
> till the very end of time limit. (I then solved it correctly within minutes 
> sitting on a sh*****). Pathetic!
> 
> So, please, tell me how do you prepare for this. I am making plans for next 
> year. I will never be even remotely close to winning this competition (cudos 
> to Burunduk1 - респект чувак!) but I feel I could do Round1 on first go
> 
> Thank
> 
> Neugomonney

There are three main skills to doing well in the Code Jam:

1. Quickly figuring out the right algorithm for solving each problem;
2. Minimizing debugging e.g. "writing it right the first time";
3. Correctly identifying and handling all corner cases.

Practicing on old Code Jam problems is a great way of improving all three. The 
best participants have years of practice and have built up huge libraries of 
canned algorithm code, but I'm convinced that anyone who is comfortable coding 
small programs should be able to qualify for Round 2.

Many people might focus on improving #1, and it is true that knowing a lot of 
algorithms and how to implement them quickly will help, but this skill is also 
the hardest to improve. To get the most bang for your buck I would instead 
focus on #2 and #3. Don't rush into implementing something until you are sure 
that your algorithm will work, and that it will run at a reasonable speed on 
the worst-case inputs. Similarly, don't waste a lot of time coming up with the 
fastest theoretical algorithm when the limits will allow a brute-force approach 
to finish in time. Focus on writing code that you have a high confidence will 
be correct, even if it is ugly or runs (slightly) slower than a more convoluted 
implementation. As you've discovered, it is difficult and time-consuming to 
debug Code Jam code, since you get virtually no feedback from the judges about 
where your code might be going wrong.

But my tip for improving your score the most, with the least training, is to 
improve #3. Spend a few minutes after you've figured out how to solve the 
problem, but before you start coding, looking at the limits and figuring out 
*all* the corner cases where your general algorithm won't work, and how to fix 
it. The Code Jam authors are very evil with their limits -- the limits will 
allow trivial cases, like a single point for the Logging problem, or a 1x1 tile 
in the Omino problem in the qualification round, and you can waste a lot of 
time debugging perfectly working code if you don't realize that these cases are 
not being handled correctly.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/b73e45ff-64bc-4394-92c0-5b8dbe5776b1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to