|
|
back to board[deleted by moderator] Edited by moderator 13.04.2004 07:47 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. you must use longint not just int, but O(N) memory. O(N^3) works, don't know if N^2 possible |
|
|