|
|
вернуться в форумDamn, I cann't solve it! Послано Alexey 2 июн 2006 17:08 Please, tell me how to solve this problem... Not solution but an idea or a hint... Thanks. Re: Damn, I cann't solve it! You just have to understand the optimal algorithm for finding a shortest way from A to B on this object. Re: Damn, I cann't solve it! Послано Alexey 2 июн 2006 20:31 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... Re: Damn, I cann't solve it! 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. Re: Damn, I cann't solve it! Послано Alexey 3 июн 2006 16:34 It must be formula, isn't it? Or there is an algo to find answer? Re: Damn, I cann't solve it! 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. Re: Damn, I cann't solve it! Sorry, could you tell me the algorithm, otherwise I don’t understand it ... |
|
|