You are an IT developer, who works in a company that produces robots. Your robot
ID: 3672228 • Letter: Y
Question
You are an IT developer, who works in a company that produces robots. Your robots are designed to do certain work in a given area (for example, vacuum-clean a room). Each robot has a map of the area uploaded into its memory. The map is partitioned into rectangles, and at each moment any robot can either stay in its current rectangle or move to one of adjacent rectangles. If a charge of some robot fall below a critical level, and there is another robot in the area with a high charge, they should be programmed to meet so that one robot can recharge another robot. You are given a task to implement this feature. You are given a map and current rectangles of two robots as an input, and your algorithm should find a rectangle, where a meeting of robots can occur in a shortest possible time.
Explanation / Answer
algorithm:
we will first create a right angled traingle with two vertices as center of the rectangles in which the robos are stood
then we will find the distance between the two robos by using th pythogress theorem .
so divide the value by 2
then move throught the number of rectangles that are equal to the result by the two robos
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.