A couple of times I’ve been asked what my favorite CS/programming problem was. I didn’t have a solid answer to give. I’ve seen many interesting problems, many difficult ones, and nearly all of them original. But none of them really stood out, until today.
It’s called Joining Points, from the IOI2006. Here you can download the statement, solution and tests. I must admit I didn’t figure it out on my own — I read the solution. And it blew me away!
I was so impressed that after implementing it, I made a visualizer using the GD library. It has been surprisingly easy, despite being the first time I use such a library. You may see the source and the Makefile. Here’s what my solution produces for one of the test cases. Looks pretty astounding, if you ask me!
To install the GD library on a Debian-based system (in case you decide to compile):
sudo aptitude install libgd2-xpm-dev