ramJha's blog

By ramJha, history, 3 years ago, In English

You are given 'N' stairs and f,p,u,d where f=final postion to reach; p=initial position u=steps jump in forward direction; d=steps jump in backward direction; and cant go ouside the N stairs find the min steps required to reach from 'p' to 'f';

Ex: n=8 f=1 p=6 u=2 d=1

ans=4

explanation:

1->3->5->4->6

Full text and comments »

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

By ramJha, history, 4 years ago, In English

I use sublime text to code in c++ for windows and i don't know how to fix infinite loop because my system gets freeze whenever it encounter infinite loop and only way to fix is to restart the pc which creates lots of problem during the contest time.

I came through this blog of preda2or but unable to implement it. I wanted to know if there's any additional approach to fix this problem and anyone who has implement above blog.

Thanks in advance:)

PS:I use input.txt and output.txt as input and output file.

Full text and comments »

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