Here is a short guide to C++ Custom Build Systems in Sublime Text. Very helpful for competitive programmers looking for fast ways to code and run. Also, I personally use terminator instead of xterm. You can also use any other terminal emulator.
http://ketangupta.in/blog/competitive/sublimetext/2016/06/28/sublime-text-competitive-programming/
Edit: Added details for Windows Users as well.