elita15's blog

By elita15, history, 9 years ago, In English

I used 2D BIT (Range Updates, Point queries) to solve this problem . Here is my solution which results in WA. Can someone please tell me why is this solution failing?

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

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

Well, this problem has a terrible problem statement. I spent sometime reading your code and it looks fine. However, the directions order I know is N, E, S, W not N, E, W, S. I know the problem statement puts them in this order and neither the problem statement nor the sample tests clarify the intended order for the problem but I had to look for accepted solutions for this problem to check the order they used and it seems like the order should be N, E, S, W

Check this https://github.com/jamesdjuhartono/SPOJ/blob/master/src/WINDVANE.cpp