Saturday, February 15, 2014

Topcoder DIV1 - A dream became true

I can surely remember the fist time I logged in the topcoder applet, actually I was looking for a new game to play, but I realized it was problem solving platform, as I had a Java 'How to program' book I bought 2 years earlier. This years were full of study and effort, trying to reach the barrier of a weak math background and a non-existent algorithmic thinking. Almost 4 years after it, I decided to take part in SRM 609. As after full plate of fish for the lunch, I turned up my notebook on and registered.

As a new strategy, I'll post the links to the problems statements here, to be faster in explaining solutions right to the point. 

MagicalStringDiv2: 

The 250 problem was a piece of cake, a simple simulation doing what the statement asks. Iterate over the string, if the index is lower the the middle of the string and the symbol is '<' or the index is above string's middle and it's '>', one have to increase the answer.
Link
 

PackingBallsDiv2: 

The problem asks for the minimum number of packages to wrap balls, some people managed to solve this problem in a greedy manner, as I already had a lot of issues trying greedy approaches in 500 problems, the classic dynamic programming was my first choice, using 'the minimum number of packages to pack R, G and B balls' as a state, then we can roll states recursively or in a iterative manner trying all the possible outcomes for the current state.

VocaloidsAndSongs: 

The weird fact in this problem is that it's also solvable with dynamic programming, and it states are very close to the 500 problems too. It a counting problem with big numbers, requiring mod operations, this one is also 'do what statement asks' but do carefully, it's easy to make mistakes with this 'mod' operations.
Link


So thats it, thanks for reading, comments are welcome.

Thursday, February 6, 2014

yet another promise

I think all my post contains messages telling that I'll be posting things more often, but it never happens. I'm back here to a quick update, I'm optimist to be very close to Div 1 in both TopCoder and Codeforces and expecting to make it as soon as possible. I'm also studying for a research paper, so I'm currently very busy. That's it.