it"s showing time limit exceeded
Doubt about what's wrong in my code for PRATA problem discussed in binary search( divide and conquer section)
@kohliaaru09
There are few mistakes in your code. I am pointing out them
- line no. 10 should be while((sum+(a[j]*i))<=mid){
- Make sum=0 inside j loop. You should have start with sum=0 for each cook.
- Remove j++ in line 15
- Also increase the size of a[] array to a[50]. Number of cook can be upto 50.
@kohliaaru09
Here is the updated code, please check here: https://ide.codingblocks.com/s/258450
1 Like
@kohliaaru09
Please mark this doubt as resolved if you don’t have any other doubt regarding this question.