You are not logged in. Please login at www.codechef.com to post your questions!

×

CHEF AND DIGIT JUMP JUNE 2014 CHALLENGE ??

I AM A BEGINNER.PLEASE EXPLAIN ME SOLUTION OF THIS PROBLEM "CHEF AND DIGIT JUMP JUNE 2014". WHAT APPROACH IS USED AND WHICH TYPE OF ALGORITHM CAN USED TO SOLVE THESE TYPE OF PROBLEM.

asked 16 Jun '14, 22:28

rahul5july's gravatar image

1★rahul5july
123
accept rate: 0%


you can look at this EDITORIAL for detailed explanation and algorithm used to solve the problem and you cam look at editorials for any contest problem you want but before looking at editorials i suggest you to try the problem as many times as you can because it will increase your thinking level in solving problem and optimizing levels. :p

link

answered 16 Jun '14, 22:38

nanda19's gravatar image

3★nanda19
8253618
accept rate: 7%

you will have to think this problem from graph point of view where there are edges from an index to another where one can jump (here to i-1,i+1 and all points having same value as that of arr[i]). after this you have to find shortest path from index 0 to n-1. This can be done by djikstra but since all edge weights are 1 you can perform bfs traversal.

link

answered 16 Jun '14, 22:36

ashwini007k's gravatar image

4★ashwini007k
78791528
accept rate: 6%

toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×1,664
×966
×690
×558
×10

question asked: 16 Jun '14, 22:28

question was seen: 4,457 times

last updated: 16 Jun '14, 22:38