"The solution presented here is ~550x faster than the following naive program."
... std::cin >> v; ...
Oh come on! That's I/O for every item, I'm surprised it's not even slower.