What is wrong with my code? passes the example test cases but gives WA when submitting.
Spoj Problem Link: https://www.spoj.com/problems/PRATA/
My Solution Link:
What is wrong with my code? passes the example test cases but gives WA when submitting.
Spoj Problem Link: https://www.spoj.com/problems/PRATA/
My Solution Link:
your approach is not correct
you have to apply binary search on time
and check in given time(mid) can you cook the paratas
if yes return true;else false
accordingly change start and end of binary search
Reference Code
I also applied binary search on time accordingly but can not figure it out where is the problem.
I just used your CanCookPrata function in place of my can_cook and it got accepted.
okay then good
now you can mark doubt as resolved