shishir.hstu's blog

By shishir.hstu, history, 4 weeks ago, In English,

Problem link: https://www.spoj.com/problems/QUEEN/ I am getting this problem WA. But don't know why? My code:https://pastebin.com/bieHYd72 Thanks advance.

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

»
4 weeks ago, # |
  Vote: I like it +11 Vote: I do not like it

Seriously bro? You expect people to help when all you provide is a mess of code?

»
4 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

The problem states that 'The queen can go any number of cells in any of eight directions in a single move' but you move it only one cell. So besides vis you need real grid.

  • »
    »
    4 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    The queen can go any number of cells in any of eight directions in a single move, but it can't pass through or stand on the occupied cells and leave the board. I also try to go eight direction from current position without occupied cell not only one cell.

»
4 weeks ago, # |
  Vote: I like it +5 Vote: I do not like it

The queen's dress might be getting in the way, so she trips. Buy her another one.