what may be the end condition for max time
i.e. how to find the worst-case time taken
PRATA (Spoj) Problem
please see my code
what is the problem in my code is my logic correct
even if I am taking not using long int then I am not getting correct answer
I feel your logic is correct but your implementation might be wrong
sir please check the code
@vivekpatel since this is a really simple question I would recommend you to debug your errors yourself otherwise you will not learn.
Sir I have really tried for long time
Please give me hint other wise
I have to use long long int
@vivekpatel let me go through your code again. And do update the variables with long long int
@vivekpatel the value of r which you are calculating is wrong.
R has to be lowestrank * ( prata*prata+1)/2
Sir can you explain me That I was asking at first
even now I am not getting correct answer
@vivekpatel Use long long int every place. Your answer might overflow. It is possible that you can get wrong answer because of that