June long problem ( dynamic programming and bfs)

I am getting wa in this question but i am unable to detect the bug…
question link-CodeChef: Practical coding for everyone
solution link- ko3FYE - Online C++ Compiler & Debugging Tool - Ideone.com

1 Like