Simple DP problem- TRIP

Revision en2, by sagar_is_dumb, 2018-04-22 10:13:33

I am trying to solve this problem on codechef https://www.codechef.com/problems/TRIP.

My code is :- https://ideone.com/ZgA0yr

I am not sure why am I getting TLE. Any help would be great.

P.S: Code is small to go through so please go through it if possible.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English sagar_is_dumb 2018-04-22 10:13:33 4 Tiny change: 'f possible :P' -> 'f possible.'
en1 English sagar_is_dumb 2018-04-22 00:19:46 290 Initial revision (published)