You are on the top floor of a multiplex complex and want to go the ground floor,The lift is not working so you have to search for the staircase on each floor and go down to the exit.
As you are new to that multiplex,you have taken the floor map.you are given a map. M of building in a 2D matrix.
. All walkable space are represented by a 0
. Staircases are represented by a 1
.your starting position is represented by 2 and can be at any level of the car park
.Exit is always at the bottom right of the ground floor
. you must use the staircases 1 s to go down a level
.Each floor will have only one staircase apart from the ground floor which will not have any staircases.find the quickest route of the multiplex complex
input:the first line of input contains two space separated integer N representing the number of rows and C representing the number of columns
the next N lines contain C space-separated integers
I/P: 3 3
1 0 2
0 1 0
0 0 0
O/P:L2 D1 R1 D1 R1
My orders
- How it works
- Examples
- Reviews
- Blog
- Homework Answers
- Submit
- Sign in
- How it works
- Examples
- Reviews
- Homework answers
- Blog
- Contact us
Submit
106 576
Assignments Done
97.1%
Successfully Done
In August 2022
Your physics assignments can be a real challenge, and the due date can be really close — feel free to use our assistance and get the desired result.
Physics
Be sure that math assignments completed by our experts will be error-free and done according to your instructions specified in the submitted order form.
Math
Our experts will gladly share their knowledge and help you with programming projects. Keep up with the world’s newest programming trends.
Programming
Answer to Question #256479 in Python for rasi
Answers
>
Programming & Computer Science
>
Python
Question #256479
20] Given that a man can jump X meters and after every jump, he comes back 1 meter as it is a slope model and given N poles to cross. Then print how many jumps are needed.
Expert's answer
x = int[input['can jmp to:']]
n = int[intpu['distance:']]
i = 0
while i * [ x - 1 ] + x < n:
i = i + 1
print[i + 1]
Need a fast expert's response?
Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!
Place free inquiry
Calculate the price
Learn more about our help with Assignments: Python
Comments
No comments. Be the first!
Leave a comment
Related Questions
- 1. 19. A thief trying to escape from jail. He has to cross N walls each with varying heights [every h
- 2. 18. Write a code to find the smallest divisible number of a given number[here number is input].
- 3. 17. Write a code for returning a character at the specified index.
- 4. How to reverse a string using the OOPS concept in python.
- 5. 15. Write a program to find the count of non-repeating characters.
- 6. 14. For the given number ‘n’ [0