problem is arising in line 17 while taking input for the array. it is taking first 3 input suucessfully but not the fourth input due to which the program is coming to halt and the time limit exceeds. I am unable to understand the problem.
Book allocation problem - Input Problem
Ok, i try to understand the code and let u know the changes…
??
problem still not solved
I have edited your code, I have included one bool isValid function in your code,… If you didnt understood any changes…, you can ask.
mam, I did understand the bool function but what was the problem in my code.
I did the work of the function inside the loop itself, but while debugging the code halted at the last value of input at cin
No, the logic you were using was not exactly what I have used in the code… since the output was coming out to be wrong…You can also go through the online video lecture on book allocation problem, I have made changes in your code according to that only…
problem - https://hack.codingblocks.com/app/contests/141/p/739
soln - https://ide.codingblocks.com/s/170153
getting tle in some of the cases.
Problem not solved??
Manish, pls can you tell the name of ques… As it is not visible to me…