Блог пользователя Nuruhuhuhu

Автор Nuruhuhuhu, история, 6 лет назад, По-английски

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.

  • Проголосовать: нравится
  • +9
  • Проголосовать: не нравится

»
6 лет назад, # |
Rev. 2   Проголосовать: нравится +8 Проголосовать: не нравится

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

  • »
    »
    6 лет назад, # ^ |
      Проголосовать: нравится +8 Проголосовать: не нравится

    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 :)

»
6 лет назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

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

  • »
    »
    6 лет назад, # ^ |
      Проголосовать: нравится +3 Проголосовать: не нравится

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