|
|
вернуться в форумПоказать все сообщения Спрятать все сообщенияPlease, tell me how to solve this problem... Not solution but an idea or a hint... Thanks. You just have to understand the optimal algorithm for finding a shortest way from A to B on this object. I'm trying... Should I write a Function(n) wich returns the number of row in wich n shands? There is three kinds of "rows", so, what shall I do? Give me the way to think... Find optimal path from 1 to some small numbers. It will help you. Try to change direction in the optimal path as few times as possible. It must be formula, isn't it? Or there is an algo to find answer? There is a formula, but it's a bit easier to solve using algo. Convert input numbers into row/column. Row will not exceed ~33000, so you can iterate over row using algo and use math over column. Sorry, could you tell me the algorithm, otherwise I don’t understand it ... |
|
|