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

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

So the problem state that " if one square is completely inside another, they intersect. If the two squares only share one common point, they are also considered to intersect. "

Yet this code gets AC and all it does try each pair of points and check if it intersect with the any other line in the second square so in total there are 4 lines of the sides and 2 for the diagonals.

Yet you can have a square totally inside the other without any of the 6 lines intersect the second square as in this

0 0 100 0 100 100 0 100

1 53 3 51 5 53 3 55

The answer should be yes yet the AC code gets no. I'm not sure if there's a wrong case tho or just weak ones.

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

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

I think AlexSkidanov should see this

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

That's one of the reasons to exist hacks

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

    Having hacks in pretests is one thing and missing a case from the main tests is another