Code blocks compiler error. Matrix of a[101][101] works, but when increasing to a[1001][1001] it throws an error

-1

The compiler error is :

Process returned -1073741571 (0xC00000FD) execution time : 0.997 s Press any key to continue.

My code:

#include <iostream>

using namespace std;

int main()
{
    int n,m,a[1001][1001];
    cin>>n>>m;
    for(int i = 1; i<=n; ++i)
        for(int j = 1; j<=m; ++j)
            cin>>a[i][j];
    int s = 0;
    for(int j = 1; j<=m; ++j)
    {
        int minn = a[1][j];
        for(int i = 2; i<=n; ++i)
            if(a[i][j]<minn) minn = a[i][j];


        s = s + minn;
    }
    cout<<s;
}

Is this due to memory allocation? Do I have to reserve more ram to code blocks?

c++
compiler-construction
codeblocks
asked on Stack Overflow May 26, 2021 by Lucas Lucas • edited May 26, 2021 by Lucas Lucas

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0