kmod's blog


Topcoder SRM 456

Today I took part in another Topcoder SRM -- only a week after the previous one.  I hadn't competed in any since March, and now there were two in the space of a week.

Anyway, the competition this time was fairly easy, so it seems like they were (over-)compensating from the hard tournament last week.  The first problem was literally 6 lines of code.  I'm interested to see the solution to the second -- most of the solutions I saw were binary search algorithms that would narrow it down to an answer, which seemed very unsatisfactory to me.  (And by the way, one trick I learned from this competition, that in retrospect should have been more obvious, is that when you do a binary search with a fixed starting range and a fixed precision target, it's better to just hardcode the number of iterations it will take rather than testing that the precision is smaller than the target -- this avoids any possible floating point issues.)

Comments (0) Trackbacks (0)

No comments yet.

Leave a comment

No trackbacks yet.