Strange TLE caused by array initiizaion

  • 0

    Hello Guys,

    I got TLE by this initialization:

        int mm[700][700];
    //  same code here
        for(int i=0;i<700;i++)
            for(int j=0;j<700;j++)

    Then accepted by his:

        vector<vector<int> > mm;
    //  same code here
        for(int i=0;i<=N1;i++)
            vector<int> vr(N2+1,-1);

    Both have declaration in global and code in main() running only one time.

    Just feel weird of the cause.

    Can anyone educate me?


Log in to reply

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.