Spoj problem ROCK

[Rock][1] I’ve solved it using DP and it is my AC code


[2], Any other better insight  to this problem?


  [1]: http://www.spoj.com/problems/ROCK/
  [2]: http://ideone.com/l0eLq0
1 Like
//