|
|
вернуться в форумHow to solve this problem? Someone who solved this problem, give some ideas, please. Re: How to solve this problem? The answer is n^2 + floor(n/2) + 1. Place n^2 in top-left corner and proceed row-by-row, column-by-column. For every cell choose maximal unused value, such that its sum with left and upper numbers is <= that minimal sum. I have no idea why that works. The formula above was found empirically - these are minimal values when this greedy algorithm converges. Edited by author 24.07.2008 15:00 Re: How to solve this problem? Real cheat! With this formula the problem is VERY easy! IMHO, without it - it would take much more time and efforts to get AC. |
|
|