ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1302. Delta-wave

Damn, I cann't solve it!
Posted by Alexey 2 Jun 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!
Posted by Samsonov Alex [USU] 2 Jun 2006 19:58
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!
Posted by Alexey 2 Jun 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!
Posted by Burunduk1 2 Jun 2006 22:30
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!
Posted by Alexey 3 Jun 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!
Posted by Denis Koshman 25 Jul 2008 20:00
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!
Posted by Anton Beriugin 26 May 2022 17:45
Sorry, could you tell me the algorithm, otherwise I don’t understand it ...