Unlike most participants, SnackDown 2015 was not my first SnackDown. I had also participated in the first edition of SnackDown (SnackDown 2010). I came 32nd (of 74 teams!) in the semifinal round and hence, of course did not qualify for the finals (in that year only top 7 qualified and each team had 3 members). While disappointed, I remember feeling very excited and inspired by the idea of an annual Indian onsite contest. I kept asking Anup for details of the next edition. And hence, was very disappointed when there was no SnackDown the next year or the next to next year…
Finally, SnackDown 2015 was announced. After 5 long years, I was still as excited to be participating in it. 🙂 I teamed up with Deepa Panwar to form team ancalagon (aside: We were tired of all team names being “good” names. We decided on a darker team name. Ancalagon is the largest of dragons with the villain in The Silmarillion). We scraped through Round 1A even though we managed to solve just one problem. We were severely out of practice and tried to practice a bit before the elimination round. The quality of problems even in these rounds was great (even better than the Cook-Offs).
The elimination round was an eventful one. We solved the first 2 easier problems in less than 30 minutes but struggled with the 3rd problem, which required careful implementation. After trying a lot, we managed to get it accepted. We finished at a distant #82 and were sure would not qualify for the finals (top 25 Indian teams). Luckily, it turned out we just about qualified.
We could not practice much after that as we were quite busy – our final semester of M. Tech at IIT Bombay was approaching its end. In fact, our MTP (The final Thesis presentation) was just a day before the finals. We raced against time to complete the exit formalities at our college. As the contest was in Mumbai – just a few kilometers from our college, we managed to arrive late at night before the finals.
It made us miss the pre contest events. 🙁 The event itself was extremely well organized. I had participated in ICPC World Finals at Ekaterinburg, Russia in 2014. The arrangement and facilities at the SnackDown Venue reminded me of the world finals – it was that good. All teams stayed at the famous Marriot Hotel and all travel facilities were arranged by Directi. The contest environment was awesome too – with large screens showing the scores. I loved how snacks and coffee were being served during the contest.
Coming to the contest itself, since we were out of practice for a long time, we had to decide on some good strategy to even have a chance at being the Indian Champions. In competitive coding, there is always a tradeoff between accuracy and speed. Unless you are tourist or Petr (or in Indian context – unless you are Sumeet Verma or Surya Kiran :P), you have to thoroughly test your solution before submitting. I usually go for accuracy over speed.
However, looking at the top teams at the finals, I estimated that we were all roughly the same level and the champion will be decided on the penalty (and not on number of problems solved). Also, SnackDown has ICPC type scoring system. Which meant the time at which one solves the first few problems have a huge impact on the total penalty. Suppose, a team can solve 4 problems taking 15, 20, 30 and 60 minutes of computer time, the total penalty will be 15 + 35 (second problem will be solved at 15 + 20) + 65 + 125 = 240. Now, if the team decides to sacrifice accuracy for speed and solve the first 2 problems 5 minutes earlier each (by perhaps not testing on a lot of cases), the penalty will be: 10 + 25 + 55 + 115 = 205. A saving of 35 minutes of penalty time! Now even if they get a penalty on the easier problem because of lack of testing, the team will still be ahead of their usual penalty by 15 minutes.
That was our plan going into the finals – we will solve the first couple of problems as fast as possible and hope that the tradeoff works in our favor. And it did. 😀 We solved the first 3 problems in under one hour. For the next problem, I had underestimated the difficulty of one of the problems and kept trying it. Luckily Deepa spotted the correct problem early and we decided to switch to it. Despite incurring a WA on one of the first 3 problems, we were well ahead in terms of penalty. So, we spent some time on the fourth problem and caught quite a few bugs in it before submitting it at about 2 hours into the contest. Our estimate was right – as many as 8 Indian teams solved 4 problems and the winner was decided on penalty. And we finished almost 49 minutes of penalty time ahead of the second placed team.
Overall, it was a very fun and exciting contest and we enjoyed every moment of it. This year it is back and will be bigger than ever as even the global top 25 teams will be invited onsite. I would like to end this with one observation – many people don’t register for such contest as they feel they are “not that good” at competitive coding. My advice is – don’t think that, just participate in as many contests as possible and have fun. Who knows, you may come 32nd in one edition and win in the next ;).