Nuruhuhuhu's blog

By Nuruhuhuhu, history, 7 years ago, In English

Can anyone please help me in this one? I am getting WA on test 24 and I can't find any mistake in my idea. Has anyone faced the same verdict in test 24? Maybe it's corner case or something. I'd be really grateful if someone helped me out. I am trying it from this afternoon without any break and now I'm frustrated :(

Here's the link to the problem.

  • Vote: I like it
  • +9
  • Vote: I do not like it

»
7 years ago, # |
Rev. 2   Vote: I like it +8 Vote: I do not like it

I have no idea about the test-case numbers, but some weird edge-cases might be the problem.

  • check if you put the end of the point in a corner (it's not allowed)
  • check if the end-points of your segments lie on different parts of the rectangle
  • if you print doubles, make sure to print them with fixed precision. Sadly, if not, they'll look like 1.000e7 when printed
  • try to see if the answer is good for N = 1

Hope it'll help

  • »
    »
    7 years ago, # ^ |
      Vote: I like it +8 Vote: I do not like it

    Thank you for your comment. I am quite sure I've ensured no. 1 and 2, but I'll recheck. About 3, I have used printf(".10f"), it should work, right? And I am also quite sure I've checked no 4, but I'll recheck. And if some other cases come to your mind, it'd be really helpful if you share. Thanks again :)

»
7 years ago, # |
  Vote: I like it +3 Vote: I do not like it

Can anyone provide some critical test case? I am also getting WA on 24th test.

  • »
    »
    7 years ago, # ^ |
      Vote: I like it +3 Vote: I do not like it

    found my mistake. I was not considering the case where we have to draw the only line joining two adjacent edges.