Can you please spot the mistake ?
Painter's Problem
Hey @coderajay03
Did some corrections in isvalid function : https://ide.codingblocks.com/s/349510
Ckeck that
Also it will still not run because some more corrections need to be done:
- Increase value of ans to compare i.e ans=1e9
- Use variables as long long
- Dont multiply t during bin search ,multiply by t only when returning answer
4)Retruning answer should be % with 10000003
Okay worked accordingly but still 2nd and 3rd test case failing here is new code:
Hey @coderajay03
Dont multiply t during bin search or in isvalid ,multiply by t only when returning answer otherwise may result in overflow
okay this is working out . Thankyou and overflow case would be 1 person painting 100000 boards of 100000 length units and time for each unit length 10^6 ?Right?
1 Like
Yup correct…