|
|
|
|
|
by Natsu
5444 days ago
|
|
It's weird how full-circle I've gone on this. I went from "the naive solution is easy enough to write" to "I bet there's a more efficient way" to "oh crap, my solution doesn't actually work, because the preferences can have ties." I did have the fun of coding up the algorithm I saw on HN a while back, though, so it was fun. |
|
Seems like I should have been doing it as an A problem, where you can just use the H algorithm. So I want to say thanks to the guys who posted the challenge: it was a good excuse to teach myself some combinatorial algorithms.
Lest anyone wonder, I'm using those weird abbreviations so as not to spoil the problem. Figuring out which algorithms to use is half the fun and I read about quite a few different types of problems before figuring out which was the most suitable. I'd hate to deny anyone else the same learning experience.