"The broken pedometer" optimizations
Just some hints to improve your C++ code if not the algorithm logic:


Use const references for passing big objects like vectors to functions. For example, replace vector&lt;string&gt; leds by const vector&lt;string&gt;&amp; leds in any_duplicates. Otherwise, it will perform a full copy of the vector and its elements. Here, const reference is right since the vector is not modified.
You could add std::ios_base::sync_with_stdio(false); at the beginning of your code. Default thing for streams is to call C functions from cstdio. Putting that line allow streams not to use those functions and then to be faster.
For readability, you could replace (*it).stuff by it-&gt;stuff everywhere.
vector::size() returns a size_t and that's what you use in your loops. No need to cast the result to an int.
I may be wrong, but I don't see any functions from cstdlib used here. You could get rid of that header.


You could also probably improve readability and performance by using features from C++11 (usable with the option -std=c++0x with gcc). I don't know if your contest allows it or not.