skpro19's blog

By skpro19, history, 8 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

»
8 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.

  • »
    »
    8 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 ?