krishan's blog

How can we solve http://www.spoj.com/SPOJ/problems/CTRICK/ this question? What is the approach behind this?

By krishan, 9 years ago, In English

I only need the hint. That's all. I don't need the exact solution. Thank you.

Full text and comments »

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

By krishan, 9 years ago, In English
  • Vote: I like it
  • -3
  • Vote: I do not like it

By krishan, 9 years ago, In English

I mean how can we proceed. Can we apply dfs or bfs in this question?

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By krishan, 9 years ago, In English

How can we apply recursion in this question?

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By krishan, 9 years ago, In English

My approach is that if both the cats are diagonal to each other then only mouse can not escape otherwise it will escape. Also I have doubt When both cats are diagonal to each other is it necessary that the mouse should be in the middle of the diagonal? or it is not and we have to only for diagonal? Please correct me if i am wrong and also provide me the right approach? www.spoj.com/problems/CATM

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By krishan, 9 years ago, In English

Hello i am new to programming. I want to learn how to do bit masking? Please provide some tutorials or any books

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By krishan, 9 years ago, In English

How can i approach this problem using graphs and dynamic programming? Brute force is giving TLE. I am trying to find the all the distance from '*' to each other and then finding the minimum distance.but it's not working? Can anyone please help?

Full text and comments »

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

By krishan, 9 years ago, In English

I know we can solve it using segment tree but i am not unable to proceed. There are two things we need to solve this question are that the sum should be zero (if we consider '(' as 1 and ')' as -1) and i am not able to figure out the other thing? Can you please tell the second point which is important and explain it as well?

Full text and comments »

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