Painter's Problem

Can you please spot the mistake ?

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:

  1. Increase value of ans to compare i.e ans=1e9
  2. Use variables as long long
  3. 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…