Compiler's bug or mine?

Правка en2, от AliHeidary1381, 2019-02-26 07:09:33

I was getting a strange bug in my code. The buggy part of my code is the following:

1st Code

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:

2nd Code

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?

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en4 Английский AliHeidary1381 2019-02-26 07:12:52 4
en3 Английский AliHeidary1381 2019-02-26 07:12:12 82
en2 Английский AliHeidary1381 2019-02-26 07:09:33 102
en1 Английский AliHeidary1381 2019-02-26 07:06:56 969 Initial revision (published)