isls's blog

By isls, 10 years ago, In English

recently i was trying to solve this problem second time to solve problem like this i.e. bfs 3D array with bitmasks i got TLE

this is my code

so any one can help me ?!

thanks in advance

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

| Write comment?
»
10 years ago, # |
  Vote: I like it 0 Vote: I do not like it

You don't need 3D array at bfs. You can iterate over bitmasks and check way by bfs for each bitmask. There are your code with small changes, that gets AC: http://ideone.com/QC3vmQ