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


[closed] Manhattan Rectangle wrong explanation for example

In the given example how can we determine the points just from the first 2 queries? I mean the Manhattan distance can be zero for every point on the rectangle.

P.S. The query is unanswered in the comment section for more than a day now.

asked 09 Feb, 00:07

code_locked's gravatar image

accept rate: 0%

closed 09 Feb, 14:39

vijju123's gravatar image

5★vijju123 ♦♦

Well, It didn't indicate in that problem they have solved by using 2 queries only.
It has just shown input/output example.
Had they shown actual no. of queries needed for solving it, and the queries....
Solutions would have been quite guessable.
Off course that's not something they would want.

(09 Feb, 01:59) babangain3★

The question has been closed for the following reason "Question is related to ongoing contest" by vijju123 09 Feb, 14:39

@babangain just read the first two lines of the explanation. It states "From answers to the first two queries, it is clear that the lower left and upper right corner of the rectangle lie at points (1,2) and (3,4) respectively." And I know that if they would have given actual queries than answer would be obvious but my point is that given explanation is incorrect for the sample question.


answered 09 Feb, 03:17

code_locked's gravatar image

accept rate: 0%

That's right. What does it meams when Manhattan distance is 0? It means that both point are same. The point whose Manhattan distance from (1,2) is 0 is (1,2) only. Same for (3,4). So whatever is written in explanation is true.

(09 Feb, 11:10) vichitr5★

And yeah, First two queries conclude that points are (1,2) and (3,4). It doesn't mean only 2 are sufficient. That's why they have taken two more points. But as you can see distances increase. That confirms answer.

(09 Feb, 11:15) vichitr5★

Yes that's true that it confirms that point are (1,2) and (3,4) but it does not confirm that they are the lowermost and upper-right coordinates of the rectangle. Any point on the rectangle would give 0.That is my point that it isn't clear from the first 2 queries that xl, yl and xu, yu are (1,2) and (3,4)

(09 Feb, 13:09) code_locked3★

That's the reason to take next 2 queries. Did you read my comment?

(09 Feb, 22:26) vichitr5★

Follow this question

By Email:

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



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "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:


question asked: 09 Feb, 00:07

question was seen: 813 times

last updated: 09 Feb, 22:26