I was getting a strange bug in my code. The buggy part of my code is the following: ~~~~~
include
using namespace std;
const int N = 10'000'005; array <pair <int,int>, N> a;
int main() {} ~~~~~ It gives the following error: cc1plus.exe: out of memory allocating 134221823 bytes And of course, I have 128 MB of free memory (It's more than 4 GB free).
But I thought that the problem might be from std::array, and I was right. So when I modified my code as: ~~~~~
include
using namespace std;
const int N = 10'000'005; pair <int,int> a[N];
int main() { } ~~~~~ The code compiles without any error. I am using MinGW w64 7.3.0 from here (it's exactly the codeforces's compiler, so the code get's compilation error when submitting) but other compilers haven't this problem (like CLang LLVM). Where do you think the problem is and why? And how can I solve it?




