15 / 15
Apr 2007

In the description of this problem, are there any mistakes? i mean, the line that include vertex B is perpendicular to CP, and the line that crosses vertex C is perpendicular to CP as well? is this right?

  • created

    Apr '07
  • last reply

    Apr '07
  • 14

    replies

  • 1.1k

    views

  • 10

    users

  • 1

    link

Yes, there was a missprint. I've fixed it.

I probably misunderstood the question, but can someone tell me if there is only one or there are infinitely many squares given in the input?

There is only one. (Or at least, this is how I interpreted it and got AC)

Darko, if you're trying to say that the input does not uniquely describe a square, you are most definitely correct. There are indeed infinitely many squares that share the same side length and intersection point of the diagonals. However, a few quick sketches and a bit of geometry should be enough to convince you that the answer will be the same regardless of which of the many possible squares you use in your solution.

In fact, it's possible to make claims that are even stronger than that, but I'll let you investigate those on your own wink

Thanks - that makes the problem much easier (I have no idea how I would solve it with the square of arbitrary orientation).

They should maybe change the problem statement. It does not say anywhere that the square will have certain orientation.

[EDIT] Wow, we posted at the same time - I will look into it smile

No, I think it's better this way. I looked at it exactly the same way as you:
But doesn't the answer depend on the orientation of the square?

And then I realized.... smiley

I just got AC in 1.6 secs (don't ask...) But it says time limit is 1sec?

If I had to guess, I think that's for the same reason as this2--that is, the grader is running multiple test cases behind the scenes, each with a limit of a second, and then outputting the sum of the times taken on the problem.

yes thats it!

This problem's statement is indeed flawed... you can't just make assumptions based on the solution in the problem statement. From a reader's point of view, it isn't clear which of the squares should be considered, and if you really want to imply that this doesn't matter, it must be clearly stated somewhere.

There is no reason for it to be stated in the problem statement. The writer probably wanted us to discover that the orientation of the square is irrelevant. Unfortunately, this aspect of the problem is now spoiled for whoever reads the forums before coding a solution.

Hi,

  There's something I don't understand about the problem. It says that for each square's vertice a line is drawn through that vertice and it's perpendicular to the line PAndTheVerticeNextClockWiseToThatVertice. My question is this: Does this line have to go through that line (PAndTheVerticeNextClockWiseToThatVertice)? . For example, being P a point of the line AD. Does the line that's drown through D have to be drawn through the line AP as well?. If the answer is yes, then there's no way to draw a line through D with such specifications

I hope somebody understand what I wrote

THX

You're right, the writer probably did intend that. But that doesn't mean theres no reason for something to be stated; the problem is indeed flawed. All relevant parts of a problem should be stated in the actual problem statement, not input/output data. The problem statement tells us that we are given a square and need to work out if four given lines intersect at a point. We look at the output data and find out that we are not given a square. We are given some information about a square.