skpro19's blog

By skpro19, history, 9 years ago, In English

The problem is Chef and Frogs. I have solved it using DFS and I am getting a WA. Can someone please point out the error ?

My solution is My Solution

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

»
9 years ago, # |
Rev. 3   Vote: I like it 0 Vote: I do not like it

why are you using dfs ?

Also each query should be executed in o(1) or o(log(n)) otherwise you will get a TLE.

  • »
    »
    9 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I understand that but i wanted to know what is wrong with my solution ?