Random algorithmic problems on C++