|
|
back to boardWhy Memory Limit Exceeded?????HELPHELPHELPHELPHELP [deleted by moderator] Edited by moderator 13.04.2004 07:47 Re: Why Memory Limit Exceeded?????HELPHELPHELPHELPHELP You may use 'short int' instead of 'int' sizeof(int) == 4, sizeof (short int) == 2, according to the timus's compiler. So unsigned short int is enough. Even if this program fits in the memory limit, it will get TL. You have complexity of O(N^3). Mine was the same, it needs 3-4 secs. for N=500 K=300. I'm now wondering how to solve this problem. Re: Why Memory Limit Exceeded?????HELPHELPHELPHELPHELP Posted by sloboz 13 Apr 2004 05:32 you must use longint not just int, but O(N) memory. O(N^3) works, don't know if N^2 possible |
|
|