9
Some minor things, but may still be worth mentioning:
Whenever std::endl is used, the buffer gets flushed, which can add to performance a bit, especially if it's done multiple times.
In order to get a newline without this added flush, use "\n" within an output statement:
std::cout << "\n";
A...