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

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

I need some help in this problem. I think that my approach is correct, but I am getting WA unfortunately. Please do help..

Here's the link to the question: http://www.spoj.com/problems/CATM/

My approach is as follows :

  1. If the mouse is at the edge of the field,i.e., if its x-co-ordinate=1 or n and if its y-co-ordinate=1 or m, then it can escape.

  2. If both the cats and the mouse lie in a diagonal(either left diagonal or right diagonal) with the mouse in the middle, then the mouse can't escape.

  3. For any other condition, the mouse can escape.

Here's the link to my solution : http://ideone.com/exE3j3

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