Painter problem run error


it is giving run error for 5 test cases

https://ide.codingblocks.com/s/200912 two test cases are giving wrong answer, where is problem?

I have edited your code… Try to submit it now…

1 Like

how it worked ?

  1. how do we know that size of boards is given in sorted order? (is it bcoz A0,A1,…,AN )?
  2. why it didnt work when i placed %10000003 condition in return part ?

You can perform sorting operation… But even if u dont do sorting, by default the test cases are in sorted order only…and for the simplicity, I have taken mod value in main,rather than inside a return statement… You can try tht as well.

1 Like