I have done most of my contests using a 2015 MacBook Pro, and my experience, for the most part, was not as enjoyable as when I did contests using my Windows PC. I saw that my Mac compiled using C++98, even though my gcc compiler was up to date, so I could not use stuff like range-based loop, auto, etc in my code. I got used to it, but recently I started looking for a fix again, and luckily I was able to do it.
Installing GCC
Mac's default c++ compiler Clang does not include many of the libraries provided by GCC, which is regularly used by competitive programmers, like #include <bits/stdc++.h>
and Policy Based Data Structures. First set up homebrew in your mac and install gcc using brew install gcc
. To find more details about this step check the links provided at the end.
Using GCC to the fullest
To use features you first need to know the version of gcc you are using. To